package com.kurumi.util;

import java.io.OutputStream;
import java.math.BigDecimal;
import java.nio.charset.Charset;
import java.text.ParseException;
import java.util.Date;
import java.util.List;
import java.util.Map;

import com.linuxense.javadbf.DBFDataType;
import com.linuxense.javadbf.DBFException;
import com.linuxense.javadbf.DBFField;
import com.linuxense.javadbf.DBFWriter;

public class JavaDBFUtil {

	public static void exportDBFOfPageIndex1(OutputStream out,List<Map<String, Object>> datas) throws DBFException {
		DBFWriter writer = new DBFWriter(out, Charset.forName("GBK"));
		DBFField fields[] = new DBFField[282];
		//[start] 0-29
		fields[0] = new DBFField();
		fields[0].setName("USERNAME");
		fields[0].setType(DBFDataType.CHARACTER);
		fields[0].setLength(60);
		fields[1] = new DBFField();
		fields[1].setName("YLFKFS");
		fields[1].setType(DBFDataType.CHARACTER);
		fields[1].setLength(100);
		fields[2] = new DBFField();
		fields[2].setName("JKKH");
		fields[2].setType(DBFDataType.CHARACTER);
		fields[2].setLength(100);
		fields[3] = new DBFField();
		fields[3].setName("ZYCS");
		fields[3].setType(DBFDataType.CHARACTER);
		fields[3].setLength(100);
		fields[4] = new DBFField();
		fields[4].setName("BAH");
		fields[4].setType(DBFDataType.CHARACTER);
		fields[4].setLength(100);
		fields[5] = new DBFField();
		fields[5].setName("XM");
		fields[5].setType(DBFDataType.CHARACTER);
		fields[5].setLength(100);
		fields[6] = new DBFField();
		fields[6].setName("XB");
		fields[6].setType(DBFDataType.CHARACTER);
		fields[6].setLength(100);
		fields[7] = new DBFField();
		fields[7].setName("CSRQ");
		fields[7].setType(DBFDataType.CHARACTER);
		fields[7].setLength(12);
		fields[8] = new DBFField();
		fields[8].setName("NL");
		fields[8].setType(DBFDataType.NUMERIC);
		fields[8].setLength(10);
		fields[9] = new DBFField();
		fields[9].setName("GJ");
		fields[9].setType(DBFDataType.CHARACTER);
		fields[9].setLength(100);
		fields[10] = new DBFField();
		fields[10].setName("BZYZSNL");
		fields[10].setType(DBFDataType.CHARACTER);
		fields[10].setLength(10);
		fields[11] = new DBFField();
		fields[11].setName("XSECSTZ");
		fields[11].setType(DBFDataType.NUMERIC);
		fields[11].setLength(12);
		fields[11].setDecimalCount(2);
		fields[12] = new DBFField();
		fields[12].setName("XSERYTZ");
		fields[12].setType(DBFDataType.NUMERIC);
		fields[12].setLength(10);
		fields[12].setDecimalCount(2);
		fields[13] = new DBFField();
		fields[13].setName("CSD_SG");
		fields[13].setType(DBFDataType.CHARACTER);
		fields[13].setLength(10);
		fields[14] = new DBFField();
		fields[14].setName("CSD_SI");
		fields[14].setType(DBFDataType.CHARACTER);
		fields[14].setLength(10);
		fields[15] = new DBFField();
		fields[15].setName("CSD_QX");
		fields[15].setType(DBFDataType.CHARACTER);
		fields[15].setLength(10);
		fields[16] = new DBFField();
		fields[16].setName("CSD_DZ");
		fields[16].setType(DBFDataType.CHARACTER);
		fields[16].setLength(200);
		fields[17] = new DBFField();
		fields[17].setName("GG_SG");
		fields[17].setType(DBFDataType.CHARACTER);
		fields[17].setLength(10);
		fields[18] = new DBFField();
		fields[18].setName("GG_SI");
		fields[18].setType(DBFDataType.CHARACTER);
		fields[18].setLength(10);
		fields[19] = new DBFField();
		fields[19].setName("MZ");
		fields[19].setType(DBFDataType.CHARACTER);
		fields[19].setLength(100);
		fields[20] = new DBFField();
		fields[20].setName("SFZJLB");
		fields[20].setType(DBFDataType.CHARACTER);
		fields[20].setLength(100);
		fields[21] = new DBFField();
		fields[21].setName("SFZH");
		fields[21].setType(DBFDataType.CHARACTER);
		fields[21].setLength(100);
		fields[22] = new DBFField();
		fields[22].setName("ZY");
		fields[22].setType(DBFDataType.CHARACTER);
		fields[22].setLength(100);
		fields[23] = new DBFField();
		fields[23].setName("HY");
		fields[23].setType(DBFDataType.CHARACTER);
		fields[23].setLength(100);
		fields[24] = new DBFField();
		fields[24].setName("XZZ_SG");
		fields[24].setType(DBFDataType.CHARACTER);
		fields[24].setLength(10);
		fields[25] = new DBFField();
		fields[25].setName("XZZ_SI");
		fields[25].setType(DBFDataType.CHARACTER);
		fields[25].setLength(10);
		fields[26] = new DBFField();
		fields[26].setName("XZZ_QX");
		fields[26].setType(DBFDataType.CHARACTER);
		fields[26].setLength(10);
		fields[27] = new DBFField();
		fields[27].setName("XZZ_DZ");
		fields[27].setType(DBFDataType.CHARACTER);
		fields[27].setLength(200);
		fields[28] = new DBFField();
		fields[28].setName("DH");
		fields[28].setType(DBFDataType.CHARACTER);
		fields[28].setLength(100);
		fields[29] = new DBFField();
		fields[29].setName("YB1");
		fields[29].setType(DBFDataType.CHARACTER);
		fields[29].setLength(100);
		//[end]
		//[start] 30-59
		fields[30] = new DBFField();
		fields[30].setName("HKDZ_SG");
		fields[30].setType(DBFDataType.CHARACTER);
		fields[30].setLength(10);
		fields[31] = new DBFField();
		fields[31].setName("HKDZ_SI");
		fields[31].setType(DBFDataType.CHARACTER);
		fields[31].setLength(10);
		fields[32] = new DBFField();
		fields[32].setName("HKDZ_QX");
		fields[32].setType(DBFDataType.CHARACTER);
		fields[32].setLength(10);
		fields[33] = new DBFField();
		fields[33].setName("HKDZ_DZ");
		fields[33].setType(DBFDataType.CHARACTER);
		fields[33].setLength(200);
		fields[34] = new DBFField();
		fields[34].setName("YB2");
		fields[34].setType(DBFDataType.CHARACTER);
		fields[34].setLength(100);
		fields[35] = new DBFField();
		fields[35].setName("GZDWJDZMC");
		fields[35].setType(DBFDataType.CHARACTER);
		fields[35].setLength(200);
		fields[36] = new DBFField();
		fields[36].setName("GZDWJDZ_SG");
		fields[36].setType(DBFDataType.CHARACTER);
		fields[36].setLength(10);
		fields[37] = new DBFField();
		fields[37].setName("GZDWJDZ_SI");
		fields[37].setType(DBFDataType.CHARACTER);
		fields[37].setLength(10);
		fields[38] = new DBFField();
		fields[38].setName("GZDWJDZ_QX");
		fields[38].setType(DBFDataType.CHARACTER);
		fields[38].setLength(10);
		fields[39] = new DBFField();
		fields[39].setName("GZDWJDZ_DZ");
		fields[39].setType(DBFDataType.CHARACTER);
		fields[39].setLength(200);
		fields[40] = new DBFField();
		fields[40].setName("DWDH");
		fields[40].setType(DBFDataType.CHARACTER);
		fields[40].setLength(100);
		fields[41] = new DBFField();
		fields[41].setName("YB3");
		fields[41].setType(DBFDataType.CHARACTER);
		fields[41].setLength(100);
		fields[42] = new DBFField();
		fields[42].setName("LXRXM");
		fields[42].setType(DBFDataType.CHARACTER);
		fields[42].setLength(100);
		fields[43] = new DBFField();
		fields[43].setName("GX");
		fields[43].setType(DBFDataType.CHARACTER);
		fields[43].setLength(100);
		fields[44] = new DBFField();
		fields[44].setName("DZ_SG");
		fields[44].setType(DBFDataType.CHARACTER);
		fields[44].setLength(10);
		fields[45] = new DBFField();
		fields[45].setName("DZ_SI");
		fields[45].setType(DBFDataType.CHARACTER);
		fields[45].setLength(10);
		fields[46] = new DBFField();
		fields[46].setName("DZ_QX");
		fields[46].setType(DBFDataType.CHARACTER);
		fields[46].setLength(10);
		fields[47] = new DBFField();
		fields[47].setName("DZ_DZ");
		fields[47].setType(DBFDataType.CHARACTER);
		fields[47].setLength(200);
		fields[48] = new DBFField();
		fields[48].setName("DH2");
		fields[48].setType(DBFDataType.CHARACTER);
		fields[48].setLength(100);
		fields[49] = new DBFField();
		fields[49].setName("RYTJ");
		fields[49].setType(DBFDataType.CHARACTER);
		fields[49].setLength(100);
		fields[50] = new DBFField();
		fields[50].setName("ZZYLJGMC");
		fields[50].setType(DBFDataType.CHARACTER);
		fields[50].setLength(200);
		fields[51] = new DBFField();
		fields[51].setName("RYSJ");
		fields[51].setType(DBFDataType.CHARACTER);
		fields[51].setLength(12);
		fields[52] = new DBFField();
		fields[52].setName("RYSJS");
		fields[52].setType(DBFDataType.NUMERIC);
		fields[52].setLength(24);
		fields[53] = new DBFField();
		fields[53].setName("RYKB");
		fields[53].setType(DBFDataType.CHARACTER);
		fields[53].setLength(100);
		fields[54] = new DBFField();
		fields[54].setName("RYBF");
		fields[54].setType(DBFDataType.CHARACTER);
		fields[54].setLength(100);
		fields[55] = new DBFField();
		fields[55].setName("ZKKB");
		fields[55].setType(DBFDataType.CHARACTER);
		fields[55].setLength(100);
		fields[56] = new DBFField();
		fields[56].setName("ZKKB1");
		fields[56].setType(DBFDataType.CHARACTER);
		fields[56].setLength(100);
		fields[57] = new DBFField();
		fields[57].setName("ZKKB2");
		fields[57].setType(DBFDataType.CHARACTER);
		fields[57].setLength(100);
		fields[58] = new DBFField();
		fields[58].setName("CYSJ");
		fields[58].setType(DBFDataType.CHARACTER);
		fields[58].setLength(12);
		fields[59] = new DBFField();
		fields[59].setName("CYSJS");
		fields[59].setType(DBFDataType.NUMERIC);
		fields[59].setLength(24);
		//[end]

		//[start] 60-118
		fields[60] = new DBFField();
		fields[60].setName("CYKB");
		fields[60].setType(DBFDataType.CHARACTER);
		fields[60].setLength(100);
		fields[61] = new DBFField();
		fields[61].setName("CYBF");
		fields[61].setType(DBFDataType.CHARACTER);
		fields[61].setLength(100);
		fields[62] = new DBFField();
		fields[62].setName("SJZYTS");
		fields[62].setType(DBFDataType.CHARACTER);
		fields[62].setLength(100);

		fields[63] = new DBFField();
		fields[63].setName("MZZD");
		fields[63].setType(DBFDataType.CHARACTER);
		fields[63].setLength(200);
		fields[64] = new DBFField();
		fields[64].setName("JBBM");
		fields[64].setType(DBFDataType.CHARACTER);
		fields[64].setLength(100);
		fields[65] = new DBFField();
		fields[65].setName("ZYZD");
		fields[65].setType(DBFDataType.CHARACTER);
		fields[65].setLength(200);
		fields[66] = new DBFField();
		fields[66].setName("JBDM");
		fields[66].setType(DBFDataType.CHARACTER);
		fields[66].setLength(10);
		fields[67] = new DBFField();
		fields[67].setName("RYBQ");
		fields[67].setType(DBFDataType.CHARACTER);
		fields[67].setLength(200);

		for(int i = 1;i<=15;i++){
			fields[68+(i-1)*3] = new DBFField();
			fields[68+(i-1)*3].setName("QTZD"+i);
			fields[68+(i-1)*3].setType(DBFDataType.CHARACTER);
			fields[68+(i-1)*3].setLength(200);

			fields[69+(i-1)*3] = new DBFField();
			fields[69+(i-1)*3].setName("JBDM"+i);
			fields[69+(i-1)*3].setType(DBFDataType.CHARACTER);
			fields[69+(i-1)*3].setLength(100);

			fields[70+(i-1)*3] = new DBFField();
			fields[70+(i-1)*3].setName("RYBQ"+i);
			fields[70+(i-1)*3].setType(DBFDataType.CHARACTER);
			fields[70+(i-1)*3].setLength(100);
		}
		fields[113] = new DBFField();
		fields[113].setName("WBYY");
		fields[113].setType(DBFDataType.CHARACTER);
		fields[113].setLength(254);
		fields[114] = new DBFField();
		fields[114].setName("H23");
		fields[114].setType(DBFDataType.CHARACTER);
		fields[114].setLength(100);
		fields[115] = new DBFField();
		fields[115].setName("BLZD");
		fields[115].setType(DBFDataType.CHARACTER);
		fields[115].setLength(100);
		fields[116] = new DBFField();
		fields[116].setName("JBMM");
		fields[116].setType(DBFDataType.CHARACTER);
		fields[116].setLength(100);
		fields[117] = new DBFField();
		fields[117].setName("BLH");
		fields[117].setType(DBFDataType.CHARACTER);
		fields[117].setLength(100);
		fields[118] = new DBFField();
		fields[118].setName("ICDO3");
		fields[118].setType(DBFDataType.CHARACTER);
		fields[118].setLength(100);
		//[end]

		//[start] 119-141
		fields[119] = new DBFField();
		fields[119].setName("ZGZDYJ");
		fields[119].setType(DBFDataType.CHARACTER);
		fields[119].setLength(100);
		fields[120] = new DBFField();
		fields[120].setName("YWGM");
		fields[120].setType(DBFDataType.CHARACTER);
		fields[120].setLength(100);
		fields[121] = new DBFField();
		fields[121].setName("GMYW");
		fields[121].setType(DBFDataType.CHARACTER);
		fields[121].setLength(254);
		fields[122] = new DBFField();
		fields[122].setName("SWHZSJ");
		fields[122].setType(DBFDataType.CHARACTER);
		fields[122].setLength(100);
		fields[123] = new DBFField();
		fields[123].setName("XX");
		fields[123].setType(DBFDataType.CHARACTER);
		fields[123].setLength(100);
		fields[124] = new DBFField();
		fields[124].setName("TJHL_T");
		fields[124].setType(DBFDataType.CHARACTER);
		fields[124].setLength(50);
		fields[125] = new DBFField();
		fields[125].setName("YJHL_T");
		fields[125].setType(DBFDataType.NUMERIC);
		fields[125].setLength(10);
		fields[126] = new DBFField();
		fields[126].setName("EJHL_T");
		fields[126].setType(DBFDataType.NUMERIC);
		fields[126].setLength(10);
		fields[127] = new DBFField();
		fields[127].setName("SJHL_T");
		fields[127].setType(DBFDataType.NUMERIC);
		fields[127].setLength(10);
		fields[128] = new DBFField();
		fields[128].setName("RH");
		fields[128].setType(DBFDataType.CHARACTER);
		fields[128].setLength(100);
		fields[129] = new DBFField();
		fields[129].setName("KZR");
		fields[129].setType(DBFDataType.CHARACTER);
		fields[129].setLength(100);
		fields[130] = new DBFField();
		fields[130].setName("YLZZ");
		fields[130].setType(DBFDataType.CHARACTER);
		fields[130].setLength(100);
		fields[131] = new DBFField();
		fields[131].setName("ZRYS");
		fields[131].setType(DBFDataType.CHARACTER);
		fields[131].setLength(100);
		fields[132] = new DBFField();
		fields[132].setName("ZZYS");
		fields[132].setType(DBFDataType.CHARACTER);
		fields[132].setLength(100);
		fields[133] = new DBFField();
		fields[133].setName("ZYYS");
		fields[133].setType(DBFDataType.CHARACTER);
		fields[133].setLength(100);
		fields[134] = new DBFField();
		fields[134].setName("ZRHS");
		fields[134].setType(DBFDataType.CHARACTER);
		fields[134].setLength(100);
		fields[135] = new DBFField();
		fields[135].setName("JXYS");
		fields[135].setType(DBFDataType.CHARACTER);
		fields[135].setLength(100);
		fields[136] = new DBFField();
		fields[136].setName("SXYS");
		fields[136].setType(DBFDataType.CHARACTER);
		fields[136].setLength(100);
		fields[137] = new DBFField();
		fields[137].setName("BMY");
		fields[137].setType(DBFDataType.CHARACTER);
		fields[137].setLength(100);
		fields[138] = new DBFField();
		fields[138].setName("BAZL");
		fields[138].setType(DBFDataType.CHARACTER);
		fields[138].setLength(100);
		fields[139] = new DBFField();
		fields[139].setName("ZKYS");
		fields[139].setType(DBFDataType.CHARACTER);
		fields[139].setLength(100);
		fields[140] = new DBFField();
		fields[140].setName("ZKHS");
		fields[140].setType(DBFDataType.CHARACTER);
		fields[140].setLength(100);

		fields[141] = new DBFField();
		fields[141].setName("ZKRQ");
		fields[141].setType(DBFDataType.CHARACTER);
		fields[141].setLength(12);
		//[end]

		//[start] 142-237
		for(int i = 1;i <=8;i++){
			fields[142+(i-1)*12] = new DBFField();
			fields[142+(i-1)*12].setName("SSJCZBM"+i);
			fields[142+(i-1)*12].setType(DBFDataType.CHARACTER);
			fields[142+(i-1)*12].setLength(100);
			fields[143+(i-1)*12] = new DBFField();
			fields[143+(i-1)*12].setName("SSJCZRQ"+i);
			fields[143+(i-1)*12].setType(DBFDataType.CHARACTER);
			fields[143+(i-1)*12].setLength(12);
			fields[144+(i-1)*12] = new DBFField();
			fields[144+(i-1)*12].setName("SSJB"+i);
			fields[144+(i-1)*12].setType(DBFDataType.CHARACTER);
			fields[144+(i-1)*12].setLength(100);
			fields[145+(i-1)*12] = new DBFField();
			fields[145+(i-1)*12].setName("SSLX"+i);
			fields[145+(i-1)*12].setType(DBFDataType.CHARACTER);
			fields[145+(i-1)*12].setLength(100);
			fields[146+(i-1)*12] = new DBFField();
			fields[146+(i-1)*12].setName("SSJCZMC"+i);
			fields[146+(i-1)*12].setType(DBFDataType.CHARACTER);
			fields[146+(i-1)*12].setLength(200);
			fields[147+(i-1)*12] = new DBFField();
			fields[147+(i-1)*12].setName("SZ"+i);
			fields[147+(i-1)*12].setType(DBFDataType.CHARACTER);
			fields[147+(i-1)*12].setLength(100);
			fields[148+(i-1)*12] = new DBFField();
			fields[148+(i-1)*12].setName("YZ"+i);
			fields[148+(i-1)*12].setType(DBFDataType.CHARACTER);
			fields[148+(i-1)*12].setLength(100);
			fields[149+(i-1)*12] = new DBFField();
			fields[149+(i-1)*12].setName("EZ"+i);
			fields[149+(i-1)*12].setType(DBFDataType.CHARACTER);
			fields[149+(i-1)*12].setLength(100);
			fields[150+(i-1)*12] = new DBFField();
			fields[150+(i-1)*12].setName("QKDJ"+i);
			fields[150+(i-1)*12].setType(DBFDataType.CHARACTER);
			fields[150+(i-1)*12].setLength(100);
			fields[151+(i-1)*12] = new DBFField();
			fields[151+(i-1)*12].setName("QKYHLB"+i);
			fields[151+(i-1)*12].setType(DBFDataType.CHARACTER);
			fields[151+(i-1)*12].setLength(100);
			fields[152+(i-1)*12] = new DBFField();
			fields[152+(i-1)*12].setName("MZFS"+i);
			fields[152+(i-1)*12].setType(DBFDataType.CHARACTER);
			fields[152+(i-1)*12].setLength(100);
			fields[153+(i-1)*12] = new DBFField();
			fields[153+(i-1)*12].setName("MZYS"+i);
			fields[153+(i-1)*12].setType(DBFDataType.CHARACTER);
			fields[153+(i-1)*12].setLength(100);
		}
		//[end]
		//[start] 238-end
		fields[238] = new DBFField();
		fields[238].setName("RJQK");
		fields[238].setType(DBFDataType.CHARACTER);
		fields[238].setLength(100);
		fields[239] = new DBFField();
		fields[239].setName("WCQK");
		fields[239].setType(DBFDataType.CHARACTER);
		fields[239].setLength(100);
		fields[240] = new DBFField();
		fields[240].setName("BYQK");
		fields[240].setType(DBFDataType.CHARACTER);
		fields[240].setLength(100);
		fields[241] = new DBFField();
		fields[241].setName("LYFS");
		fields[241].setType(DBFDataType.CHARACTER);
		fields[241].setLength(100);
		fields[242] = new DBFField();
		fields[242].setName("YZZY_YLJG");
		fields[242].setType(DBFDataType.CHARACTER);
		fields[242].setLength(200);
		fields[243] = new DBFField();
		fields[243].setName("WSY_YLJG");
		fields[243].setType(DBFDataType.CHARACTER);
		fields[243].setLength(200);
		fields[244] = new DBFField();
		fields[244].setName("SFZZYJH");
		fields[244].setType(DBFDataType.CHARACTER);
		fields[244].setLength(100);
		fields[245] = new DBFField();
		fields[245].setName("MD");
		fields[245].setType(DBFDataType.CHARACTER);
		fields[245].setLength(100);
		fields[246] = new DBFField();
		fields[246].setName("RYQ_T");
		fields[246].setType(DBFDataType.NUMERIC);
		fields[246].setLength(12);
		fields[247] = new DBFField();
		fields[247].setName("RYQ_XS");
		fields[247].setType(DBFDataType.NUMERIC);
		fields[247].setLength(24);
		fields[248] = new DBFField();
		fields[248].setName("RYQ_F");
		fields[248].setType(DBFDataType.NUMERIC);
		fields[248].setLength(12);
		fields[249] = new DBFField();
		fields[249].setName("RYH_T");
		fields[249].setType(DBFDataType.NUMERIC);
		fields[249].setLength(12);
		fields[250] = new DBFField();
		fields[250].setName("RYH_XS");
		fields[250].setType(DBFDataType.NUMERIC);
		fields[250].setLength(24);
		fields[251] = new DBFField();
		fields[251].setName("RYH_F");
		fields[251].setType(DBFDataType.NUMERIC);
		fields[251].setLength(12);
		fields[252] = new DBFField();
		fields[252].setName("ZFY");
		fields[252].setType(DBFDataType.NUMERIC);
		fields[252].setLength(12);
		fields[252].setDecimalCount(2);
		fields[253] = new DBFField();
		fields[253].setName("ZFJE");
		fields[253].setType(DBFDataType.NUMERIC);
		fields[253].setLength(12);
		fields[253].setDecimalCount(2);
		fields[254] = new DBFField();
		fields[254].setName("YLFUF");
		fields[254].setType(DBFDataType.NUMERIC);
		fields[254].setLength(12);
		fields[254].setDecimalCount(2);
		fields[255] = new DBFField();
		fields[255].setName("ZLCZF");
		fields[255].setType(DBFDataType.NUMERIC);
		fields[255].setLength(12);
		fields[255].setDecimalCount(2);
		fields[256] = new DBFField();
		fields[256].setName("HLF");
		fields[256].setType(DBFDataType.NUMERIC);
		fields[256].setLength(12);
		fields[256].setDecimalCount(2);
		fields[257] = new DBFField();
		fields[257].setName("QTFY");
		fields[257].setType(DBFDataType.NUMERIC);
		fields[257].setLength(12);
		fields[257].setDecimalCount(2);
		fields[258] = new DBFField();
		fields[258].setName("BLZDF");
		fields[258].setType(DBFDataType.NUMERIC);
		fields[258].setLength(12);
		fields[258].setDecimalCount(2);
		fields[259] = new DBFField();
		fields[259].setName("SYSZDF");
		fields[259].setType(DBFDataType.NUMERIC);
		fields[259].setLength(12);
		fields[259].setDecimalCount(2);
		fields[260] = new DBFField();
		fields[260].setName("YXXZDF");
		fields[260].setType(DBFDataType.NUMERIC);
		fields[260].setLength(12);
		fields[260].setDecimalCount(2);
		fields[261] = new DBFField();
		fields[261].setName("LCZDXMF");
		fields[261].setType(DBFDataType.NUMERIC);
		fields[261].setLength(12);
		fields[261].setDecimalCount(2);
		fields[262] = new DBFField();
		fields[262].setName("FSSZLXMF");
		fields[262].setType(DBFDataType.NUMERIC);
		fields[262].setLength(12);
		fields[262].setDecimalCount(2);
		fields[263] = new DBFField();
		fields[263].setName("WLZLF");
		fields[263].setType(DBFDataType.NUMERIC);
		fields[263].setLength(12);
		fields[263].setDecimalCount(2);
		fields[264] = new DBFField();
		fields[264].setName("SSZLF");
		fields[264].setType(DBFDataType.NUMERIC);
		fields[264].setLength(12);
		fields[264].setDecimalCount(2);
		fields[265] = new DBFField();
		fields[265].setName("MAF");
		fields[265].setType(DBFDataType.NUMERIC);
		fields[265].setLength(12);
		fields[265].setDecimalCount(2);
		fields[266] = new DBFField();
		fields[266].setName("SSF");
		fields[266].setType(DBFDataType.NUMERIC);
		fields[266].setLength(12);
		fields[266].setDecimalCount(2);
		fields[267] = new DBFField();
		fields[267].setName("KFF");
		fields[267].setType(DBFDataType.NUMERIC);
		fields[267].setLength(12);
		fields[267].setDecimalCount(2);
		fields[268] = new DBFField();
		fields[268].setName("ZYZLF");
		fields[268].setType(DBFDataType.NUMERIC);
		fields[268].setLength(12);
		fields[268].setDecimalCount(2);
		fields[269] = new DBFField();
		fields[269].setName("XYF");
		fields[269].setType(DBFDataType.NUMERIC);
		fields[269].setLength(12);
		fields[269].setDecimalCount(2);
		fields[270] = new DBFField();
		fields[270].setName("KJYWF");
		fields[270].setType(DBFDataType.NUMERIC);
		fields[270].setLength(12);
		fields[270].setDecimalCount(2);
		fields[271] = new DBFField();
		fields[271].setName("ZCYF");
		fields[271].setType(DBFDataType.NUMERIC);
		fields[271].setLength(12);
		fields[271].setDecimalCount(2);
		fields[272] = new DBFField();
		fields[272].setName("ZCYF1");
		fields[272].setType(DBFDataType.NUMERIC);
		fields[272].setLength(12);
		fields[272].setDecimalCount(2);
		fields[273] = new DBFField();
		fields[273].setName("XF");
		fields[273].setType(DBFDataType.NUMERIC);
		fields[273].setLength(12);
		fields[273].setDecimalCount(2);
		fields[274] = new DBFField();
		fields[274].setName("BDBLZPF");
		fields[274].setType(DBFDataType.NUMERIC);
		fields[274].setLength(12);
		fields[274].setDecimalCount(2);
		fields[275] = new DBFField();
		fields[275].setName("QDBLZPF");
		fields[275].setType(DBFDataType.NUMERIC);
		fields[275].setLength(12);
		fields[275].setDecimalCount(2);
		fields[276] = new DBFField();
		fields[276].setName("NXYZLZPF");
		fields[276].setType(DBFDataType.NUMERIC);
		fields[276].setLength(12);
		fields[276].setDecimalCount(2);
		fields[277] = new DBFField();
		fields[277].setName("XBYZLZPF");
		fields[277].setType(DBFDataType.NUMERIC);
		fields[277].setLength(12);
		fields[277].setDecimalCount(2);
		fields[278] = new DBFField();
		fields[278].setName("HCYYCLF");
		fields[278].setType(DBFDataType.NUMERIC);
		fields[278].setLength(12);
		fields[278].setDecimalCount(2);
		fields[279] = new DBFField();
		fields[279].setName("YYCLF");
		fields[279].setType(DBFDataType.NUMERIC);
		fields[279].setLength(12);
		fields[279].setDecimalCount(2);
		fields[280] = new DBFField();
		fields[280].setName("YCXYYCLF");
		fields[280].setType(DBFDataType.NUMERIC);
		fields[280].setLength(12);
		fields[280].setDecimalCount(2);
		fields[281] = new DBFField();
		fields[281].setName("QTF");
		fields[281].setType(DBFDataType.NUMERIC);
		fields[281].setLength(12);
		fields[281].setDecimalCount(2);
		//[end]
		writer.setFields(fields);

		// now populate DBFWriter
		//
		for (Map<String, Object> data : datas) {
			/*Map<String, Object> jsonMap = (Map<String, Object>)data.get("jsonMap");*/
			Map<String, Object> jsonMap = data;
			if(jsonMap != null){
				Object rowData[] = new Object[282];
				Map<String, Object> basicInfo = (Map<String, Object>)jsonMap.get("basicInfo");
				Map<String, Object> cureInfo = (Map<String, Object>)jsonMap.get("cureInfo");
				//[start] 0-29
				rowData[0] = getStringValue("山东曲阜人民医院");
				Object medicalPayTypeCode = basicInfo.get("medicalPayTypeCode");
				rowData[1] = getStringValue(medicalPayTypeCode);
				Object medicalHealthNumber = basicInfo.get("medicalHealthNumber");
				rowData[2] = getStringValue(medicalHealthNumber);
				Object visitNumber = basicInfo.get("visitNumber");
				rowData[3] = getStringValue(visitNumber);
				Object mrId = basicInfo.get("mrId");
				rowData[4] = getStringValue(mrId);
				Object patientName = basicInfo.get("patientName");
				rowData[5] = getStringValue(patientName);
				Object sexCode = basicInfo.get("sexCode");
				rowData[6] = getStringValue(sexCode);
				Object birthday = basicInfo.get("birthday");
				rowData[7] = getDateValue(birthday,"YYYYMMDD");
				Object yearOfAge = basicInfo.get("yearOfAge");
				rowData[8] =getDoubleValue(yearOfAge);
				Object nationalityCode = basicInfo.get("nationalityCode");
				rowData[9] = getStringValue(nationalityCode);
				Object monthOfAge = basicInfo.get("monthOfAge");
				rowData[10] = getStringValue(monthOfAge);
				if(cureInfo != null){
					Object babyBirthWeight = cureInfo.get("babyBirthWeight");
					rowData[11] = getDoubleValue(babyBirthWeight);
					Object babyInHospitalWeight = cureInfo.get("babyInHospitalWeight");
					rowData[12] = getDoubleValue(babyInHospitalWeight);
				}
				Map<String, Object> birthRegionalism =(Map<String, Object>)basicInfo.get("birthRegionalism");
				if(birthRegionalism != null){
					Object provinceCode = birthRegionalism.get("provinceCode");
					rowData[13] = getStringValue(provinceCode);
					Object cityCode = birthRegionalism.get("cityCode");
					rowData[14] = getStringValue(provinceCode);
					Object countyCode = birthRegionalism.get("countyCode");
					rowData[15] = getStringValue(provinceCode);
				}
				Object birthAddress = basicInfo.get("birthAddress");
				rowData[16] = getStringValue(birthAddress);

				Map<String, Object> nativePlaceRegionalism =(Map<String, Object>)basicInfo.get("nativePlaceRegionalism");

				if(nativePlaceRegionalism != null){
					Object provinceCode = nativePlaceRegionalism.get("provinceCode");
					rowData[17] = getStringValue(provinceCode);
					Object cityCode = nativePlaceRegionalism.get("cityCode");
					rowData[18] = getStringValue(cityCode);
				}
				Object nationCode = basicInfo.get("nationCode");
				rowData[19] = getStringValue(nationCode);
				Object documentTypeCode = basicInfo.get("documentTypeCode");
				rowData[20] = getStringValue(documentTypeCode);
				Object idNumber = basicInfo.get("idNumber");
				rowData[21] = getStringValue(idNumber);
				Object professionCode = basicInfo.get("professionCode");
				rowData[22] = getStringValue(professionCode);
				Object marriageCode = basicInfo.get("marriageCode");
				rowData[23] = getStringValue(marriageCode);
				Map<String, Object> permanentAddressRegionalism =(Map<String, Object>)basicInfo.get("permanentAddressRegionalism");
				if(permanentAddressRegionalism != null){
					Object provinceCode = permanentAddressRegionalism.get("provinceCode");
					rowData[24] = getStringValue(provinceCode);
					Object cityCode = permanentAddressRegionalism.get("cityCode");
					rowData[25] = getStringValue(cityCode);
					Object countyCode = permanentAddressRegionalism.get("countyCode");
					rowData[26] = getStringValue(countyCode);
				}
				Object permanentAddress = basicInfo.get("permanentAddress");
				rowData[27] = getStringValue(permanentAddress);
				Object permanentAddressPhone = basicInfo.get("permanentAddressPhone");
				rowData[28] = getStringValue(permanentAddressPhone);
				Object permanentAddressPostCode = basicInfo.get("permanentAddressPostCode");
				rowData[29] = getStringValue(permanentAddressPostCode);
				//[end]

				//[start] 30-59
				Map<String, Object> registeredAddressRegionalism =(Map<String, Object>)basicInfo.get("registeredAddressRegionalism");
				if(registeredAddressRegionalism != null){
					Object provinceCode = registeredAddressRegionalism.get("provinceCode");
					rowData[30] = getStringValue(provinceCode);
					Object cityCode = registeredAddressRegionalism.get("cityCode");
					rowData[31] = getStringValue(cityCode);
					Object countyCode = registeredAddressRegionalism.get("countyCode");
					rowData[32] = getStringValue(countyCode);
				}
				Object registeredAddress = basicInfo.get("registeredAddress");
				rowData[33] = getStringValue(registeredAddress);
				Object registeredAddressPostCode = basicInfo.get("registeredAddressPostCode");
				rowData[34] = getStringValue(registeredAddressPostCode);
				Object workUnitName = basicInfo.get("workUnitName");
				rowData[35] = getStringValue(workUnitName);
				Map<String, Object> workUnitRegionalism =(Map<String, Object>)basicInfo.get("workUnitRegionalism");
				if(workUnitRegionalism != null){
					Object provinceCode = workUnitRegionalism.get("provinceCode");
					rowData[36] = getStringValue(provinceCode);
					Object cityCode = workUnitRegionalism.get("cityCode");
					rowData[37] = getStringValue(cityCode);
					Object countyCode = workUnitRegionalism.get("countyCode");
					rowData[38] = getStringValue(countyCode);
				}
				Object workUnitAddress = basicInfo.get("workUnitAddress");
				rowData[39] = getStringValue(workUnitAddress);
				Object workUnitPhone = basicInfo.get("workUnitPhone");
				rowData[40] = getStringValue(workUnitPhone);
				Object workUnitPostCode = basicInfo.get("workUnitPostCode");
				rowData[41] = getStringValue(workUnitPostCode);
				Object linkManName = basicInfo.get("linkManName");
				rowData[42] = getStringValue(linkManName);
				Object linkManRelativeRelationCode = basicInfo.get("linkManRelativeRelationCode");
				rowData[43] = getStringValue(linkManRelativeRelationCode);

				Map<String, Object> linkManAddressRegionalism =(Map<String, Object>)basicInfo.get("linkManAddressRegionalism");
				if(linkManAddressRegionalism != null){
					Object provinceCode = linkManAddressRegionalism.get("provinceCode");
					rowData[44] = getStringValue(provinceCode);
					Object cityCode = linkManAddressRegionalism.get("cityCode");
					rowData[45] = getStringValue(cityCode);
					Object countyCode = linkManAddressRegionalism.get("countyCode");
					rowData[46] = getStringValue(countyCode);
				}
				Object linkManAddress = basicInfo.get("linkManAddress");
				rowData[47] = getStringValue(linkManAddress);
				Object linkManPhone = basicInfo.get("linkManPhone");
				rowData[48] = getStringValue(linkManPhone);
				Object inHospitalTypeCode = basicInfo.get("inHospitalTypeCode");
				rowData[49] = getStringValue(inHospitalTypeCode);
				Object shiftToUnitName = basicInfo.get("shiftToUnitName");
				rowData[50] = getStringValue(shiftToUnitName);
				Object inHospitalDateTimeObj = basicInfo.get("inHospitalDateTime");
				rowData[51] = getDateValue(inHospitalDateTimeObj,"YYYYMMDD");
				rowData[52] = getHourOfDateTime(inHospitalDateTimeObj);
				Object inDeptCode = basicInfo.get("inDeptCode");
				rowData[53] = getStringValue(inDeptCode);
				Object inHospitalHouseName = basicInfo.get("inHospitalHouseName");
				rowData[54] = getStringValue(inHospitalHouseName);
				Map<String, Object> transferDeptInfo = (Map<String, Object>)jsonMap.get("transferDeptInfo");
				if(transferDeptInfo != null){
					List<Map<String, Object>> transferDeptRecords = (List<Map<String, Object>>)transferDeptInfo.get("transferDeptRecords");
					int transferDeptRecordIndex = 0;
					for (Map<String, Object> transferDeptRecord : transferDeptRecords) {

						transferDeptRecordIndex++;
						if(transferDeptRecordIndex >3){
							break;
						}else{
							Object transferInDeptCode = transferDeptRecord.get("inDeptCode");
							rowData[54+transferDeptRecordIndex] = getStringValue(transferInDeptCode);
						}
					}
				}
				Object outHospitalDateTimeObj = basicInfo.get("outHospitalDateTime");
				rowData[58] = getDateValue(outHospitalDateTimeObj,"YYYYMMDD");
				rowData[59] = getHourOfDateTime(outHospitalDateTimeObj);
				//[end]

				//[start] 60-118
				Object outDeptCode = basicInfo.get("outDeptCode");
				rowData[60] = getStringValue(outDeptCode);
				Object outHospitalHouseName = basicInfo.get("outHospitalHouseName");
				rowData[61] = getStringValue(outHospitalHouseName);
				Object inHospitalDayNumber = basicInfo.get("inHospitalDayNumber");
				rowData[62] = getStringValue(inHospitalDayNumber);
				Map<String, Object> diseaseDiagInfo = (Map<String, Object>)jsonMap.get("hqmsDiseaseDiagInfo");
				if(diseaseDiagInfo != null){
					Map<String, Object> outpatientDiagRecord = (Map<String, Object>)diseaseDiagInfo.get("outpatientDiagRecord");
					Object outpatientDiseaseDiagName = outpatientDiagRecord.get("diseaseDiagName");
					rowData[63] = getStringValue(outpatientDiseaseDiagName);
					Object  outpatientDiseaseDiagCode = outpatientDiagRecord.get("diseaseDiagCode");
					rowData[64] = getStringValue(outpatientDiseaseDiagCode);
					Map<String, Object> mainDiagRecord = (Map<String, Object>)diseaseDiagInfo.get("mainDiagRecord");
					Object mainDiseaseDiagName = mainDiagRecord.get("diseaseDiagName");
					rowData[65] = getStringValue(mainDiseaseDiagName);
					Object mainDiseaseDiagCode = mainDiagRecord.get("diseaseDiagCode");
					rowData[66] = getStringValue(mainDiseaseDiagCode);
					Object mainInHospitalDiseaseStateCode = mainDiagRecord.get("inHospitalDiseaseStateCode");
					rowData[67] = getStringValue(mainInHospitalDiseaseStateCode);
					List<Map<String, Object>> ohterDiseaseDiagRecords = (List<Map<String, Object>>)diseaseDiagInfo.get("diseaseDiagRecords");
					int ohterDiseaseDiagRecordIndex = 0;
					for (Map<String, Object> ohterDiseaseDiagRecord : ohterDiseaseDiagRecords) {
						ohterDiseaseDiagRecordIndex++;
						if(ohterDiseaseDiagRecordIndex >15){
							break;
						}
						Object ohterDiseaseDiagName = ohterDiseaseDiagRecord.get("diseaseDiagName");
						rowData[68+(ohterDiseaseDiagRecordIndex-1)*3] = getStringValue(ohterDiseaseDiagName);
						Object ohterDiseaseDiagCode = ohterDiseaseDiagRecord.get("diseaseDiagCode");
						rowData[69+(ohterDiseaseDiagRecordIndex-1)*3] = getStringValue(ohterDiseaseDiagCode);
						Object ohterInHospitalDiseaseStateCode = ohterDiseaseDiagRecord.get("inHospitalDiseaseStateCode");
						rowData[70+(ohterDiseaseDiagRecordIndex-1)*3] = getStringValue(ohterInHospitalDiseaseStateCode);
					}
					List<Map<String, Object>> damageAndVenenationDiagRecords = (List<Map<String, Object>>)diseaseDiagInfo.get("damageAndVenenationDiagRecords");
					if(!damageAndVenenationDiagRecords.isEmpty()){
						Map<String, Object> damageAndVenenationDiagRecord = damageAndVenenationDiagRecords.get(0);
						Object damageAndVenenationDiseaseDiagName = damageAndVenenationDiagRecord.get("diseaseDiagName");
						rowData[113] = getStringValue(damageAndVenenationDiseaseDiagName);
						Object damageAndVenenationDiseaseDiagCode = damageAndVenenationDiagRecord.get("diseaseDiagCode");
						rowData[114] = getStringValue(damageAndVenenationDiseaseDiagCode);
					}
					List<Map<String, Object>> pathologyDiagRecords = (List<Map<String, Object>>)diseaseDiagInfo.get("pathologyDiagRecords");
					if(!pathologyDiagRecords.isEmpty()){
						Map<String, Object> pathologyDiagRecord = pathologyDiagRecords.get(0);
						Object pathologyDiseaseDiagName = pathologyDiagRecord.get("diseaseDiagName");
						rowData[115] = getStringValue(pathologyDiseaseDiagName);
						Object pathologyDiseaseDiagCode = pathologyDiagRecord.get("diseaseDiagCode");
						rowData[116] = getStringValue(pathologyDiseaseDiagCode);
						Object pathologyNumber = pathologyDiagRecord.get("pathologyNumber");
						rowData[117] = getStringValue(pathologyNumber);
					}
				}
				//[end]

				//[start] 119-141
				if(cureInfo != null){
					Object malignantTumorHighestDiagBasisCode = cureInfo.get("malignantTumorHighestDiagBasisCode");
					rowData[119] = getStringValue(malignantTumorHighestDiagBasisCode);

				}
				Object drugAllergyDesc = basicInfo.get("drugAllergyDesc");
				rowData[120] = getStringValue(drugAllergyDesc);
				Object autopsyCode = basicInfo.get("autopsyCode");
				rowData[122] = getStringValue(autopsyCode);
				if(cureInfo != null){
					Object bloodTypeCode = cureInfo.get("bloodTypeCode");
					rowData[123] = getStringValue(bloodTypeCode);
				}
				Map<String, Object> nurseInfo = (Map<String, Object>)jsonMap.get("nurseInfo");
				if(nurseInfo != null){
					Object specialNurseDayNumber = nurseInfo.get("specialNurseDayNumber");
					Object specialNurseHourNumber = nurseInfo.get("specialNurseHourNumber");
					if(specialNurseDayNumber != null && specialNurseHourNumber != null){
						rowData[124] = ""+getIntegerValue(specialNurseDayNumber)+" "+getIntegerValue(specialNurseHourNumber)+"/24";
					}else if(specialNurseDayNumber != null){
						rowData[124] = ""+getIntegerValue(specialNurseDayNumber);
					}else if(specialNurseHourNumber != null){
						rowData[124] = getIntegerValue(specialNurseHourNumber)+"/24";
					}
					Object firstLevelNurseDayNumber = nurseInfo.get("firstLevelNurseDayNumber");
					rowData[125] = getDoubleValue(firstLevelNurseDayNumber);
					Object secondLevelNurseDayNumber = nurseInfo.get("secondLevelNurseDayNumber");
					rowData[126] = getDoubleValue(secondLevelNurseDayNumber);
					Object threeLevelNurseDayNumber = nurseInfo.get("threeLevelNurseDayNumber");
					rowData[127] = getDoubleValue(threeLevelNurseDayNumber);

				}
				if(cureInfo != null){
					Object rhBloodTypeCode = cureInfo.get("rhBloodTypeCode");
					rowData[128] = getStringValue(rhBloodTypeCode);
				}
				if(cureInfo != null){
					List<Map<String, Object>> cureWorkers = (List<Map<String, Object>>)cureInfo.get("cureWorkers");
					String workerA1001Name=null;
					String workerA1003Name=null;
					String workerA2001Name=null;
					String workerA2003Name=null;
					String workerA2005Name=null;
					String workerA3001Name=null;
					String workerA2006Name=null;
					String workerA2008Name=null;
					String workerA4001Name=null;
					String workerA2009Name=null;
					String workerA3003Name=null;
					for (Map<String, Object> cureWorker : cureWorkers) {
						String professionTitleCode = (String)cureWorker.get("professionTitleCode");
						if("A1001".equals(professionTitleCode)){
							workerA1001Name = (String)cureWorker.get("medicalWorkerName");
						}else if("A1003".equals(professionTitleCode)){
							workerA1003Name = (String)cureWorker.get("medicalWorkerName");
						}else if("A2001".equals(professionTitleCode)){
							workerA2001Name = (String)cureWorker.get("medicalWorkerName");
						}else if("A2003".equals(professionTitleCode)){
							workerA2003Name = (String)cureWorker.get("medicalWorkerName");
						}else if("A2005".equals(professionTitleCode)){
							workerA2005Name = (String)cureWorker.get("medicalWorkerName");
						}else if("A3001".equals(professionTitleCode)){
							workerA3001Name = (String)cureWorker.get("medicalWorkerName");
						}else if("2006".equals(professionTitleCode)){
							workerA2006Name = (String)cureWorker.get("medicalWorkerName");
						}else if("A2008".equals(professionTitleCode)){
							workerA2008Name = (String)cureWorker.get("medicalWorkerName");
						}else if("A4001".equals(professionTitleCode)){
							workerA4001Name = (String)cureWorker.get("medicalWorkerName");
						}else if("A2009".equals(professionTitleCode)){
							workerA2009Name = (String)cureWorker.get("medicalWorkerName");
						}else if("A3003".equals(professionTitleCode)){
							workerA3003Name = (String)cureWorker.get("medicalWorkerName");
						}
					}
					rowData[129]=workerA1001Name;
					rowData[130]=workerA1003Name;
					rowData[131]=workerA2001Name;
					rowData[132]=workerA2003Name;
					rowData[133]=workerA2005Name;
					rowData[134]=workerA3001Name;
					rowData[135]=workerA2006Name;
					rowData[136]=workerA2008Name;
					rowData[137]=workerA4001Name;
					Object medicalRecordQualityCode = cureInfo.get("medicalRecordQualityCode");
					rowData[138] = getStringValue(medicalRecordQualityCode);
					rowData[139]=workerA2009Name;
					rowData[140]=workerA3003Name;
					Object qualityControlDateTimeObj = cureInfo.get("qualityControlDateTime");
					rowData[141]=getDateValue(qualityControlDateTimeObj, "YYYYMMDD");
				}
				//[end]

				//[start] 142-237
				Map<String, Object> operateInfo = (Map<String, Object>)jsonMap.get("hqmsOperateInfo");
				if(operateInfo != null){
					List<Map<String, Object>> operateRecords = (List<Map<String, Object>>)operateInfo.get("operateRecords");
					int operateRecordIndex = 0;
					for (Map<String, Object> operateRecord : operateRecords) {
						operateRecordIndex++;
						if(operateRecordIndex > 8){
							break;
						}
						Object operateCode = operateRecord.get("operateCode");
						rowData[142+(operateRecordIndex-1)*12]=getStringValue(operateCode);
						Object operateStartDateObj = operateRecord.get("operateStartDate");
						rowData[143+(operateRecordIndex-1)*12]=getDateValue(operateStartDateObj, "YYYYMMDD");
						Object opsLevelCode = operateRecord.get("opsLevelCode");
						rowData[144+(operateRecordIndex-1)*12]=getStringValue(opsLevelCode);
						Object patientSourceCode = operateRecord.get("patientSourceCode");
						rowData[145+(operateRecordIndex-1)*12]=getStringValue(patientSourceCode);
						Object operateName = operateRecord.get("operateName");
						rowData[146+(operateRecordIndex-1)*12]=getStringValue(operateName);
						List<Map<String, Object>> operateWorkers = (List<Map<String, Object>>)operateRecord.get("operateWorkers");
						String workerA5001Name=null;
						String workerA5002Name=null;
						String workerA5003Name=null;
						String workerA5004Name=null;
						for (Map<String, Object> operateWorker : operateWorkers) {
							String professionTitleCode = (String)operateWorker.get("professionTitleCode");
							if("A5001".equalsIgnoreCase(professionTitleCode)){
								workerA5001Name = (String)operateWorker.get("medicalWorkerName");
							}else if("A5002".equalsIgnoreCase(professionTitleCode)){
								workerA5002Name = (String)operateWorker.get("medicalWorkerName");
							}else if("A5003".equalsIgnoreCase(professionTitleCode)){
								workerA5003Name = (String)operateWorker.get("medicalWorkerName");
							}else if("A5004".equalsIgnoreCase(professionTitleCode)){
								workerA5004Name = (String)operateWorker.get("medicalWorkerName");
							}
						}
						rowData[147+(operateRecordIndex-1)*12]=workerA5001Name;
						rowData[148+(operateRecordIndex-1)*12]=workerA5003Name;
						rowData[149+(operateRecordIndex-1)*12]=workerA5004Name;
						Object incisionLevelCode = operateRecord.get("incisionLevelCode");
						rowData[150+(operateRecordIndex-1)*12]=getStringValue(incisionLevelCode);
						Object cicatrizeTypeCode = operateRecord.get("cicatrizeTypeCode");
						rowData[151+(operateRecordIndex-1)*12]=getStringValue(cicatrizeTypeCode);
						Object anaesthesiaTypeCode = operateRecord.get("anaesthesiaTypeCode");
						rowData[152+(operateRecordIndex-1)*12]=getStringValue(anaesthesiaTypeCode);
						rowData[152+(operateRecordIndex-1)*12]=workerA5002Name;
					}
				}
				//[end]

				if(cureInfo != null){
					Object whetherEnterClinicalPathsCode = cureInfo.get("whetherEnterClinicalPathsCode");
					rowData[238] = getStringValue(whetherEnterClinicalPathsCode);
					Object whetherFinishClinicalPathsCode = cureInfo.get("whetherFinishClinicalPathsCode");
					rowData[239] = getStringValue(whetherFinishClinicalPathsCode);
					Object whetherConditionVariationCode = cureInfo.get("whetherConditionVariationCode");
					rowData[240] = getStringValue(whetherConditionVariationCode);
				}

				Object outHospitalTypeCode = basicInfo.get("outHospitalTypeCode");
				rowData[241] = getStringValue(outHospitalTypeCode);
				Object receiveUnitName = basicInfo.get("receiveUnitName");
				if(outHospitalTypeCode!=null){
					if("2".equalsIgnoreCase((String)outHospitalTypeCode)){
						rowData[242] = receiveUnitName;
					}else if("3".equalsIgnoreCase((String)outHospitalTypeCode)){
						rowData[243] = receiveUnitName;
					}
				}
				if(cureInfo != null){
					Object rehospitalAimOf31Code = cureInfo.get("rehospitalAimOf31Code");
					rowData[244] = getStringValue(rehospitalAimOf31Code);
					Object rehospitalAimOf31Description = cureInfo.get("rehospitalAimOf31Description");
					rowData[245] = getStringValue(rehospitalAimOf31Description);
					Object dayOfBeforeInHospitalComa = cureInfo.get("dayOfBeforeInHospitalComa");
					rowData[246] = getDoubleValue(dayOfBeforeInHospitalComa);
					Object hourOfBeforeInHospitalComa = cureInfo.get("hourOfBeforeInHospitalComa");
					rowData[247] = getDoubleValue(hourOfBeforeInHospitalComa);
					Object minuteOfBeforeInHospitalComa = cureInfo.get("minuteOfBeforeInHospitalComa");
					rowData[248] = getDoubleValue(minuteOfBeforeInHospitalComa);
					Object dayOfAfterInHospitalComa = cureInfo.get("dayOfAfterInHospitalComa");
					rowData[249] = getDoubleValue(dayOfAfterInHospitalComa);
					Object hourOfAfterInHospitalComa = cureInfo.get("hourOfAfterInHospitalComa");
					rowData[250] = getDoubleValue(hourOfAfterInHospitalComa);
					Object minuteOfAfterInHospitalComa = cureInfo.get("minuteOfAfterInHospitalComa");
					rowData[251] = getDoubleValue(minuteOfAfterInHospitalComa);
				}

				Map<String, Object> costInfo = (Map<String, Object>)jsonMap.get("costInfo");
				if(costInfo != null){
					Object totalCost = costInfo.get("totalCost");
					rowData[252] = getDoubleValue(totalCost);
					Object selfCost = costInfo.get("selfCost");
					rowData[253] = getDoubleValue(selfCost);
					List<Map<String, Object>> costRecords = (List<Map<String, Object>>)costInfo.get("costRecords");
					int costRecordIndex = 0;
					for (Map<String, Object> costRecord : costRecords) {
						Object medicalCostTypeCode = costRecord.get("medicalCostTypeCode");
						Object costMoney = costRecord.get("costMoney");
						if(("C01001").equalsIgnoreCase((String)medicalCostTypeCode)){
							Object costC01001 = costMoney;
							rowData[254] = getDoubleValue(costC01001);
						}else if(("C01002").equalsIgnoreCase((String)medicalCostTypeCode)){
							Object costC01002 = costMoney;
							rowData[255] = getDoubleValue(costC01002);
						}else if(("C01003").equalsIgnoreCase((String)medicalCostTypeCode)){
							Object costC01003 = costMoney;
							rowData[256] = getDoubleValue(costC01003);
						}else if(("C01999").equalsIgnoreCase((String)medicalCostTypeCode)){
							Object costC01999 = costMoney;
							rowData[257] = getDoubleValue(costC01999);
						}else if(("C02001").equalsIgnoreCase((String)medicalCostTypeCode)){
							Object costC02001 = costMoney;
							rowData[258] = getDoubleValue(costC02001);
						}else if(("C02002").equalsIgnoreCase((String)medicalCostTypeCode)){
							Object costC02002 = costMoney;
							rowData[259] = getDoubleValue(costC02002);
						}else if(("C02003").equalsIgnoreCase((String)medicalCostTypeCode)){
							Object costC02003 = costMoney;
							rowData[260] = getDoubleValue(costC02003);
						}else if(("C02004").equalsIgnoreCase((String)medicalCostTypeCode)){
							Object costC02004 = costMoney;
							rowData[261] = getDoubleValue(costC02004);
						}else if(("C03001").equalsIgnoreCase((String)medicalCostTypeCode)){
							Object costC03001 = costMoney;
							rowData[262] = getDoubleValue(costC03001);
						}else if(("C03002").equalsIgnoreCase((String)medicalCostTypeCode)){
							Object costC03002 = costMoney;
							rowData[263] = getDoubleValue(costC03002);
						}else if(("C03003").equalsIgnoreCase((String)medicalCostTypeCode)){
							Object costC03003 = costMoney;
							rowData[264] = getDoubleValue(costC03003);
						}else if(("C03004").equalsIgnoreCase((String)medicalCostTypeCode)){
							Object costC03004 = costMoney;
							rowData[265] = getDoubleValue(costC03004);
						}else if(("C03005").equalsIgnoreCase((String)medicalCostTypeCode)){
							Object costC03005 = costMoney;
							rowData[266] = getDoubleValue(costC03005);
						}else if(("C04001").equalsIgnoreCase((String)medicalCostTypeCode)){
							Object costC04001 = costMoney;
							rowData[267] = getDoubleValue(costC04001);
						}else if(("C05001").equalsIgnoreCase((String)medicalCostTypeCode)){
							Object costC05001 = costMoney;
							rowData[268] = getDoubleValue(costC05001);
						}else if(("C06001").equalsIgnoreCase((String)medicalCostTypeCode)){
							Object costC06001 = costMoney;
							rowData[269] = getDoubleValue(costC06001);
						}else if(("C06002").equalsIgnoreCase((String)medicalCostTypeCode)){
							Object costC06002 = costMoney;
							rowData[270] = getDoubleValue(costC06002);
						}else if(("C07001").equalsIgnoreCase((String)medicalCostTypeCode)){
							Object costC07001 = costMoney;
							rowData[271] = getDoubleValue(costC07001);
						}else if(("C07002").equalsIgnoreCase((String)medicalCostTypeCode)){
							Object costC07002 = costMoney;
							rowData[272] = getDoubleValue(costC07002);
						}else if(("C08001").equalsIgnoreCase((String)medicalCostTypeCode)){
							Object costC08001 = costMoney;
							rowData[273] = getDoubleValue(costC08001);
						}else if(("C08002").equalsIgnoreCase((String)medicalCostTypeCode)){
							Object costC08002 = costMoney;
							rowData[274] = getDoubleValue(costC08002);
						}else if(("C08003").equalsIgnoreCase((String)medicalCostTypeCode)){
							Object costC08003 = costMoney;
							rowData[275] = getDoubleValue(costC08003);
						}else if(("C08004").equalsIgnoreCase((String)medicalCostTypeCode)){
							Object costC08004 = costMoney;
							rowData[276] = getDoubleValue(costC08004);
						}else if(("C08005").equalsIgnoreCase((String)medicalCostTypeCode)){
							Object costC08005 = costMoney;
							rowData[277] = getDoubleValue(costC08005);
						}else if(("C09001").equalsIgnoreCase((String)medicalCostTypeCode)){
							Object costC09001 = costMoney;
							rowData[278] = getDoubleValue(costC09001);
						}else if(("C09002").equalsIgnoreCase((String)medicalCostTypeCode)){
							Object costC09002 = costMoney;
							rowData[279] = getDoubleValue(costC09002);
						}else if(("C09003").equalsIgnoreCase((String)medicalCostTypeCode)){
							Object costC09003 = costMoney;
							rowData[280] = getDoubleValue(costC09003);
						}else if(("C99999").equalsIgnoreCase((String)medicalCostTypeCode)){
							Object costC99999 = costMoney;
							rowData[281] = getDoubleValue(costC99999);
						}


					}
				}

				writer.addRecord(rowData);
			}
		}

		writer.close();
	}




	public static void exportDBFOfPageIndex(OutputStream out,List<Map<String, Object>> datas) throws DBFException {
		DBFWriter writer = new DBFWriter();
		writer.setCharactersetName("GBK");
		DBFField fields[] = new DBFField[282];
		//[start] 0-29
		fields[0] = new DBFField();
		fields[0].setName("USERNAME");
		fields[0].setDataType(DBFField.FIELD_TYPE_C);
		fields[0].setFieldLength(20);
		fields[1] = new DBFField();
		fields[1].setName("YLFKFS");
		fields[1].setDataType(DBFField.FIELD_TYPE_C);
		fields[1].setFieldLength(10);
		fields[2] = new DBFField();
		fields[2].setName("JKKH");
		fields[2].setDataType(DBFField.FIELD_TYPE_C);
		fields[2].setFieldLength(10);
		fields[3] = new DBFField();
		fields[3].setName("ZYCS");
		fields[3].setDataType(DBFField.FIELD_TYPE_C);
		fields[3].setFieldLength(10);
		fields[4] = new DBFField();
		fields[4].setName("BAH");
		fields[4].setDataType(DBFField.FIELD_TYPE_C);
		fields[4].setFieldLength(10);
		fields[5] = new DBFField();
		fields[5].setName("XM");
		fields[5].setDataType(DBFField.FIELD_TYPE_C);
		fields[5].setFieldLength(10);
		fields[6] = new DBFField();
		fields[6].setName("XB");
		fields[6].setDataType(DBFField.FIELD_TYPE_C);
		fields[6].setFieldLength(10);
		fields[7] = new DBFField();
		fields[7].setName("CSRQ");
		fields[7].setDataType(DBFField.FIELD_TYPE_C);
		fields[7].setFieldLength(10);
		fields[8] = new DBFField();
		fields[8].setName("NL");
		fields[8].setDataType(DBFField.FIELD_TYPE_N);
		fields[8].setFieldLength(10);
		fields[9] = new DBFField();
		fields[9].setName("GJ");
		fields[9].setDataType(DBFField.FIELD_TYPE_C);
		fields[9].setFieldLength(10);
		fields[10] = new DBFField();
		fields[10].setName("BZYZSNL");
		fields[10].setDataType(DBFField.FIELD_TYPE_C);
		fields[10].setFieldLength(10);
		fields[11] = new DBFField();
		fields[11].setName("XSECSTZ");
		fields[11].setDataType(DBFField.FIELD_TYPE_N);
		fields[11].setFieldLength(10);
		fields[12] = new DBFField();
		fields[12].setName("XSERYTZ");
		fields[12].setDataType(DBFField.FIELD_TYPE_N);
		fields[12].setFieldLength(10);
		fields[13] = new DBFField();
		fields[13].setName("CSD_SG");
		fields[13].setDataType(DBFField.FIELD_TYPE_C);
		fields[13].setFieldLength(10);
		fields[14] = new DBFField();
		fields[14].setName("CSD_SI");
		fields[14].setDataType(DBFField.FIELD_TYPE_C);
		fields[14].setFieldLength(10);
		fields[15] = new DBFField();
		fields[15].setName("CSD_QX");
		fields[15].setDataType(DBFField.FIELD_TYPE_C);
		fields[15].setFieldLength(10);
		fields[16] = new DBFField();
		fields[16].setName("CSD_DZ");
		fields[16].setDataType(DBFField.FIELD_TYPE_C);
		fields[16].setFieldLength(10);
		fields[17] = new DBFField();
		fields[17].setName("GG_SG");
		fields[17].setDataType(DBFField.FIELD_TYPE_C);
		fields[17].setFieldLength(10);
		fields[18] = new DBFField();
		fields[18].setName("GG_SI");
		fields[18].setDataType(DBFField.FIELD_TYPE_C);
		fields[18].setFieldLength(10);
		fields[19] = new DBFField();
		fields[19].setName("MZ");
		fields[19].setDataType(DBFField.FIELD_TYPE_C);
		fields[19].setFieldLength(10);
		fields[20] = new DBFField();
		fields[20].setName("SFZJLB");
		fields[20].setDataType(DBFField.FIELD_TYPE_C);
		fields[20].setFieldLength(10);
		fields[21] = new DBFField();
		fields[21].setName("SFZH");
		fields[21].setDataType(DBFField.FIELD_TYPE_C);
		fields[21].setFieldLength(10);
		fields[22] = new DBFField();
		fields[22].setName("ZY");
		fields[22].setDataType(DBFField.FIELD_TYPE_C);
		fields[22].setFieldLength(10);
		fields[23] = new DBFField();
		fields[23].setName("HY");
		fields[23].setDataType(DBFField.FIELD_TYPE_C);
		fields[23].setFieldLength(10);
		fields[24] = new DBFField();
		fields[24].setName("XZZ_SG");
		fields[24].setDataType(DBFField.FIELD_TYPE_C);
		fields[24].setFieldLength(10);
		fields[25] = new DBFField();
		fields[25].setName("XZZ_SI");
		fields[25].setDataType(DBFField.FIELD_TYPE_C);
		fields[25].setFieldLength(10);
		fields[26] = new DBFField();
		fields[26].setName("XZZ_QX");
		fields[26].setDataType(DBFField.FIELD_TYPE_C);
		fields[26].setFieldLength(10);
		fields[27] = new DBFField();
		fields[27].setName("XZZ_DZ");
		fields[27].setDataType(DBFField.FIELD_TYPE_C);
		fields[27].setFieldLength(10);
		fields[28] = new DBFField();
		fields[28].setName("DH");
		fields[28].setDataType(DBFField.FIELD_TYPE_C);
		fields[28].setFieldLength(10);
		fields[29] = new DBFField();
		fields[29].setName("YB1");
		fields[29].setDataType(DBFField.FIELD_TYPE_C);
		fields[29].setFieldLength(10);
		//[end]
		//[start] 30-59
		fields[30] = new DBFField();
		fields[30].setName("HKDZ_SG");
		fields[30].setDataType(DBFField.FIELD_TYPE_C);
		fields[30].setFieldLength(10);
		fields[31] = new DBFField();
		fields[31].setName("HKDZ_SI");
		fields[31].setDataType(DBFField.FIELD_TYPE_C);
		fields[31].setFieldLength(10);
		fields[32] = new DBFField();
		fields[32].setName("HKDZ_QX");
		fields[32].setDataType(DBFField.FIELD_TYPE_C);
		fields[32].setFieldLength(10);
		fields[33] = new DBFField();
		fields[33].setName("HKDZ_DZ");
		fields[33].setDataType(DBFField.FIELD_TYPE_C);
		fields[33].setFieldLength(10);
		fields[34] = new DBFField();
		fields[34].setName("YB2");
		fields[34].setDataType(DBFField.FIELD_TYPE_C);
		fields[34].setFieldLength(10);
		fields[35] = new DBFField();
		fields[35].setName("GZDWJDZMC");
		fields[35].setDataType(DBFField.FIELD_TYPE_C);
		fields[35].setFieldLength(10);
		fields[36] = new DBFField();
		fields[36].setName("GZDWJDZ_SG");
		fields[36].setDataType(DBFField.FIELD_TYPE_C);
		fields[36].setFieldLength(10);
		fields[37] = new DBFField();
		fields[37].setName("GZDWJDZ_SI");
		fields[37].setDataType(DBFField.FIELD_TYPE_C);
		fields[37].setFieldLength(10);
		fields[38] = new DBFField();
		fields[38].setName("GZDWJDZ_QX");
		fields[38].setDataType(DBFField.FIELD_TYPE_C);
		fields[38].setFieldLength(10);
		fields[39] = new DBFField();
		fields[39].setName("GZDWJDZ_DZ");
		fields[39].setDataType(DBFField.FIELD_TYPE_C);
		fields[39].setFieldLength(10);
		fields[40] = new DBFField();
		fields[40].setName("DWDH");
		fields[40].setDataType(DBFField.FIELD_TYPE_C);
		fields[40].setFieldLength(10);
		fields[41] = new DBFField();
		fields[41].setName("YB3");
		fields[41].setDataType(DBFField.FIELD_TYPE_C);
		fields[41].setFieldLength(10);
		fields[42] = new DBFField();
		fields[42].setName("LXRXM");
		fields[42].setDataType(DBFField.FIELD_TYPE_C);
		fields[42].setFieldLength(10);
		fields[43] = new DBFField();
		fields[43].setName("GX");
		fields[43].setDataType(DBFField.FIELD_TYPE_C);
		fields[43].setFieldLength(10);
		fields[44] = new DBFField();
		fields[44].setName("DZ_SG");
		fields[44].setDataType(DBFField.FIELD_TYPE_C);
		fields[44].setFieldLength(10);
		fields[45] = new DBFField();
		fields[45].setName("DZ_SI");
		fields[45].setDataType(DBFField.FIELD_TYPE_C);
		fields[45].setFieldLength(10);
		fields[46] = new DBFField();
		fields[46].setName("DZ_QX");
		fields[46].setDataType(DBFField.FIELD_TYPE_C);
		fields[46].setFieldLength(10);
		fields[47] = new DBFField();
		fields[47].setName("DZ_DZ");
		fields[47].setDataType(DBFField.FIELD_TYPE_C);
		fields[47].setFieldLength(200);
		fields[48] = new DBFField();
		fields[48].setName("DH2");
		fields[48].setDataType(DBFField.FIELD_TYPE_C);
		fields[48].setFieldLength(100);
		fields[49] = new DBFField();
		fields[49].setName("RYTJ");
		fields[49].setDataType(DBFField.FIELD_TYPE_C);
		fields[49].setFieldLength(10);
		fields[50] = new DBFField();
		fields[50].setName("ZZYLJGMC");
		fields[50].setDataType(DBFField.FIELD_TYPE_C);
		fields[50].setFieldLength(200);
		fields[51] = new DBFField();
		fields[51].setName("RYSJ");
		fields[51].setDataType(DBFField.FIELD_TYPE_C);
		fields[51].setFieldLength(8);
		fields[52] = new DBFField();
		fields[52].setName("RYSJS");
		fields[52].setDataType(DBFField.FIELD_TYPE_N);
		fields[52].setFieldLength(2);
		fields[53] = new DBFField();
		fields[53].setName("RYKB");
		fields[53].setDataType(DBFField.FIELD_TYPE_C);
		fields[53].setFieldLength(10);
		fields[54] = new DBFField();
		fields[54].setName("RYBF");
		fields[54].setDataType(DBFField.FIELD_TYPE_C);
		fields[54].setFieldLength(10);
		fields[55] = new DBFField();
		fields[55].setName("ZKKB");
		fields[55].setDataType(DBFField.FIELD_TYPE_C);
		fields[55].setFieldLength(10);
		fields[56] = new DBFField();
		fields[56].setName("ZKKB1");
		fields[56].setDataType(DBFField.FIELD_TYPE_C);
		fields[56].setFieldLength(10);
		fields[57] = new DBFField();
		fields[57].setName("ZKKB2");
		fields[57].setDataType(DBFField.FIELD_TYPE_C);
		fields[57].setFieldLength(10);
		fields[58] = new DBFField();
		fields[58].setName("CYSJ");
		fields[58].setDataType(DBFField.FIELD_TYPE_C);
		fields[58].setFieldLength(8);
		fields[59] = new DBFField();
		fields[59].setName("CYSJS");
		fields[59].setDataType(DBFField.FIELD_TYPE_N);
		fields[59].setFieldLength(2);
		//[end]

		//[start] 60-118
		fields[60] = new DBFField();
		fields[60].setName("CYKB");
		fields[60].setDataType(DBFField.FIELD_TYPE_C);
		fields[60].setFieldLength(10);
		fields[61] = new DBFField();
		fields[61].setName("CYBF");
		fields[61].setDataType(DBFField.FIELD_TYPE_C);
		fields[61].setFieldLength(10);
		fields[62] = new DBFField();
		fields[62].setName("SJZYTS");
		fields[62].setDataType(DBFField.FIELD_TYPE_C);
		fields[62].setFieldLength(10);

		fields[63] = new DBFField();
		fields[63].setName("MZZD");
		fields[63].setDataType(DBFField.FIELD_TYPE_C);
		fields[63].setFieldLength(100);
		fields[64] = new DBFField();
		fields[64].setName("JBBM");
		fields[64].setDataType(DBFField.FIELD_TYPE_C);
		fields[64].setFieldLength(20);
		fields[65] = new DBFField();
		fields[65].setName("ZYZD");
		fields[65].setDataType(DBFField.FIELD_TYPE_C);
		fields[65].setFieldLength(100);
		fields[66] = new DBFField();
		fields[66].setName("JBDM");
		fields[66].setDataType(DBFField.FIELD_TYPE_C);
		fields[66].setFieldLength(20);
		fields[67] = new DBFField();
		fields[67].setName("RYBQ");
		fields[67].setDataType(DBFField.FIELD_TYPE_C);
		fields[67].setFieldLength(20);

		for(int i = 1;i<=15;i++){
			fields[68+(i-1)*3] = new DBFField();
			fields[68+(i-1)*3].setName("QTZD"+i);
			fields[68+(i-1)*3].setDataType(DBFField.FIELD_TYPE_C);
			fields[68+(i-1)*3].setFieldLength(100);

			fields[69+(i-1)*3] = new DBFField();
			fields[69+(i-1)*3].setName("JBDM"+i);
			fields[69+(i-1)*3].setDataType(DBFField.FIELD_TYPE_C);
			fields[69+(i-1)*3].setFieldLength(20);

			fields[70+(i-1)*3] = new DBFField();
			fields[70+(i-1)*3].setName("RYBQ"+i);
			fields[70+(i-1)*3].setDataType(DBFField.FIELD_TYPE_C);
			fields[70+(i-1)*3].setFieldLength(20);
		}
		fields[113] = new DBFField();
		fields[113].setName("WBYY");
		fields[113].setDataType(DBFField.FIELD_TYPE_C);
		fields[113].setFieldLength(100);
		fields[114] = new DBFField();
		fields[114].setName("H23");
		fields[114].setDataType(DBFField.FIELD_TYPE_C);
		fields[114].setFieldLength(20);
		fields[115] = new DBFField();
		fields[115].setName("BLZD");
		fields[115].setDataType(DBFField.FIELD_TYPE_C);
		fields[115].setFieldLength(100);
		fields[116] = new DBFField();
		fields[116].setName("JBMM");
		fields[116].setDataType(DBFField.FIELD_TYPE_C);
		fields[116].setFieldLength(20);
		fields[117] = new DBFField();
		fields[117].setName("BLH");
		fields[117].setDataType(DBFField.FIELD_TYPE_C);
		fields[117].setFieldLength(20);
		fields[118] = new DBFField();
		fields[118].setName("ICDO3");
		fields[118].setDataType(DBFField.FIELD_TYPE_C);
		fields[118].setFieldLength(20);
		//[end]

		//[start] 119-141
		fields[119] = new DBFField();
		fields[119].setName("ZGZDYJ");
		fields[119].setDataType(DBFField.FIELD_TYPE_C);
		fields[119].setFieldLength(10);
		fields[120] = new DBFField();
		fields[120].setName("YWGM");
		fields[120].setDataType(DBFField.FIELD_TYPE_C);
		fields[120].setFieldLength(200);
		fields[121] = new DBFField();
		fields[121].setName("GMYW");
		fields[121].setDataType(DBFField.FIELD_TYPE_C);
		fields[121].setFieldLength(200);
		fields[122] = new DBFField();
		fields[122].setName("SWHZSJ");
		fields[122].setDataType(DBFField.FIELD_TYPE_C);
		fields[122].setFieldLength(10);
		fields[123] = new DBFField();
		fields[123].setName("XX");
		fields[123].setDataType(DBFField.FIELD_TYPE_C);
		fields[123].setFieldLength(10);
		fields[124] = new DBFField();
		fields[124].setName("TJHL_T");
		fields[124].setDataType(DBFField.FIELD_TYPE_C);
		fields[124].setFieldLength(10);
		fields[125] = new DBFField();
		fields[125].setName("YJHL_T");
		fields[125].setDataType(DBFField.FIELD_TYPE_N);
		fields[125].setFieldLength(10);
		fields[126] = new DBFField();
		fields[126].setName("EJHL_T");
		fields[126].setDataType(DBFField.FIELD_TYPE_N);
		fields[126].setFieldLength(10);
		fields[127] = new DBFField();
		fields[127].setName("SJHL_T");
		fields[127].setDataType(DBFField.FIELD_TYPE_N);
		fields[127].setFieldLength(10);
		fields[128] = new DBFField();
		fields[128].setName("RH");
		fields[128].setDataType(DBFField.FIELD_TYPE_C);
		fields[128].setFieldLength(10);
		fields[129] = new DBFField();
		fields[129].setName("KZR");
		fields[129].setDataType(DBFField.FIELD_TYPE_C);
		fields[129].setFieldLength(20);
		fields[130] = new DBFField();
		fields[130].setName("YLZZ");
		fields[130].setDataType(DBFField.FIELD_TYPE_C);
		fields[130].setFieldLength(20);
		fields[131] = new DBFField();
		fields[131].setName("ZRYS");
		fields[131].setDataType(DBFField.FIELD_TYPE_C);
		fields[131].setFieldLength(20);
		fields[132] = new DBFField();
		fields[132].setName("ZZYS");
		fields[132].setDataType(DBFField.FIELD_TYPE_C);
		fields[132].setFieldLength(20);
		fields[133] = new DBFField();
		fields[133].setName("ZYYS");
		fields[133].setDataType(DBFField.FIELD_TYPE_C);
		fields[133].setFieldLength(20);
		fields[134] = new DBFField();
		fields[134].setName("ZRHS");
		fields[134].setDataType(DBFField.FIELD_TYPE_C);
		fields[134].setFieldLength(20);
		fields[135] = new DBFField();
		fields[135].setName("JXYS");
		fields[135].setDataType(DBFField.FIELD_TYPE_C);
		fields[135].setFieldLength(20);
		fields[136] = new DBFField();
		fields[136].setName("SXYS");
		fields[136].setDataType(DBFField.FIELD_TYPE_C);
		fields[136].setFieldLength(20);
		fields[137] = new DBFField();
		fields[137].setName("BMY");
		fields[137].setDataType(DBFField.FIELD_TYPE_C);
		fields[137].setFieldLength(20);
		fields[138] = new DBFField();
		fields[138].setName("BAZL");
		fields[138].setDataType(DBFField.FIELD_TYPE_C);
		fields[138].setFieldLength(20);
		fields[139] = new DBFField();
		fields[139].setName("ZKYS");
		fields[139].setDataType(DBFField.FIELD_TYPE_C);
		fields[139].setFieldLength(20);
		fields[140] = new DBFField();
		fields[140].setName("ZKHS");
		fields[140].setDataType(DBFField.FIELD_TYPE_C);
		fields[140].setFieldLength(20);

		fields[141] = new DBFField();
		fields[141].setName("ZKRQ");
		fields[141].setDataType(DBFField.FIELD_TYPE_C);
		fields[141].setFieldLength(8);
		//[end]

		//[start] 142-237
		for(int i = 1;i <=8;i++){
			fields[142+(i-1)*12] = new DBFField();
			fields[142+(i-1)*12].setName("SSJCZBM"+i);
			fields[142+(i-1)*12].setDataType(DBFField.FIELD_TYPE_C);
			fields[142+(i-1)*12].setFieldLength(200);
			fields[143+(i-1)*12] = new DBFField();
			fields[143+(i-1)*12].setName("SSJCZRQ"+i);
			fields[143+(i-1)*12].setDataType(DBFField.FIELD_TYPE_C);
			fields[143+(i-1)*12].setFieldLength(8);
			fields[144+(i-1)*12] = new DBFField();
			fields[144+(i-1)*12].setName("SSJB"+i);
			fields[144+(i-1)*12].setDataType(DBFField.FIELD_TYPE_C);
			fields[144+(i-1)*12].setFieldLength(10);
			fields[145+(i-1)*12] = new DBFField();
			fields[145+(i-1)*12].setName("SSLX"+i);
			fields[145+(i-1)*12].setDataType(DBFField.FIELD_TYPE_C);
			fields[145+(i-1)*12].setFieldLength(10);
			fields[146+(i-1)*12] = new DBFField();
			fields[146+(i-1)*12].setName("SSJCZMC"+i);
			fields[146+(i-1)*12].setDataType(DBFField.FIELD_TYPE_C);
			fields[146+(i-1)*12].setFieldLength(100);
			fields[147+(i-1)*12] = new DBFField();
			fields[147+(i-1)*12].setName("SZ"+i);
			fields[147+(i-1)*12].setDataType(DBFField.FIELD_TYPE_C);
			fields[147+(i-1)*12].setFieldLength(20);
			fields[148+(i-1)*12] = new DBFField();
			fields[148+(i-1)*12].setName("YZ"+i);
			fields[148+(i-1)*12].setDataType(DBFField.FIELD_TYPE_C);
			fields[148+(i-1)*12].setFieldLength(20);
			fields[149+(i-1)*12] = new DBFField();
			fields[149+(i-1)*12].setName("EZ"+i);
			fields[149+(i-1)*12].setDataType(DBFField.FIELD_TYPE_C);
			fields[149+(i-1)*12].setFieldLength(20);
			fields[150+(i-1)*12] = new DBFField();
			fields[150+(i-1)*12].setName("QKDJ"+i);
			fields[150+(i-1)*12].setDataType(DBFField.FIELD_TYPE_C);
			fields[150+(i-1)*12].setFieldLength(10);
			fields[151+(i-1)*12] = new DBFField();
			fields[151+(i-1)*12].setName("QKYHLB"+i);
			fields[151+(i-1)*12].setDataType(DBFField.FIELD_TYPE_C);
			fields[151+(i-1)*12].setFieldLength(10);
			fields[152+(i-1)*12] = new DBFField();
			fields[152+(i-1)*12].setName("MZFS"+i);
			fields[152+(i-1)*12].setDataType(DBFField.FIELD_TYPE_C);
			fields[152+(i-1)*12].setFieldLength(10);
			fields[153+(i-1)*12] = new DBFField();
			fields[153+(i-1)*12].setName("MZYS"+i);
			fields[153+(i-1)*12].setDataType(DBFField.FIELD_TYPE_C);
			fields[153+(i-1)*12].setFieldLength(20);
		}
		//[end]

		fields[238] = new DBFField();
		fields[238].setName("RJQK");
		fields[238].setDataType(DBFField.FIELD_TYPE_C);
		fields[238].setFieldLength(10);
		fields[239] = new DBFField();
		fields[239].setName("WCQK");
		fields[239].setDataType(DBFField.FIELD_TYPE_C);
		fields[239].setFieldLength(10);
		fields[240] = new DBFField();
		fields[240].setName("BYQK");
		fields[240].setDataType(DBFField.FIELD_TYPE_C);
		fields[240].setFieldLength(10);
		fields[241] = new DBFField();
		fields[241].setName("LYFS");
		fields[241].setDataType(DBFField.FIELD_TYPE_C);
		fields[241].setFieldLength(10);
		fields[242] = new DBFField();
		fields[242].setName("YZZY_YLJG");
		fields[242].setDataType(DBFField.FIELD_TYPE_C);
		fields[242].setFieldLength(200);
		fields[243] = new DBFField();
		fields[243].setName("WSY_YLJG");
		fields[243].setDataType(DBFField.FIELD_TYPE_C);
		fields[243].setFieldLength(200);
		fields[244] = new DBFField();
		fields[244].setName("SFZZYJH");
		fields[244].setDataType(DBFField.FIELD_TYPE_C);
		fields[244].setFieldLength(10);
		fields[245] = new DBFField();
		fields[245].setName("MD");
		fields[245].setDataType(DBFField.FIELD_TYPE_C);
		fields[245].setFieldLength(100);
		fields[246] = new DBFField();
		fields[246].setName("RYQ_T");
		fields[246].setDataType(DBFField.FIELD_TYPE_N);
		fields[246].setFieldLength(10);
		fields[247] = new DBFField();
		fields[247].setName("RYQ_XS");
		fields[247].setDataType(DBFField.FIELD_TYPE_N);
		fields[247].setFieldLength(10);
		fields[248] = new DBFField();
		fields[248].setName("RYQ_F");
		fields[248].setDataType(DBFField.FIELD_TYPE_N);
		fields[248].setFieldLength(10);
		fields[249] = new DBFField();
		fields[249].setName("RYH_T");
		fields[249].setDataType(DBFField.FIELD_TYPE_N);
		fields[249].setFieldLength(10);
		fields[250] = new DBFField();
		fields[250].setName("RYH_XS");
		fields[250].setDataType(DBFField.FIELD_TYPE_N);
		fields[250].setFieldLength(10);
		fields[251] = new DBFField();
		fields[251].setName("RYH_F");
		fields[251].setDataType(DBFField.FIELD_TYPE_N);
		fields[251].setFieldLength(10);
		fields[252] = new DBFField();
		fields[252].setName("ZFY");
		fields[252].setDataType(DBFField.FIELD_TYPE_N);
		fields[252].setFieldLength(10);
		fields[253] = new DBFField();
		fields[253].setName("ZFJE");
		fields[253].setDataType(DBFField.FIELD_TYPE_N);
		fields[253].setFieldLength(10);
		fields[254] = new DBFField();
		fields[254].setName("YLFUF");
		fields[254].setDataType(DBFField.FIELD_TYPE_N);
		fields[254].setFieldLength(10);
		fields[255] = new DBFField();
		fields[255].setName("ZLCZF");
		fields[255].setDataType(DBFField.FIELD_TYPE_N);
		fields[255].setFieldLength(10);
		fields[256] = new DBFField();
		fields[256].setName("HLF");
		fields[256].setDataType(DBFField.FIELD_TYPE_N);
		fields[256].setFieldLength(10);
		fields[257] = new DBFField();
		fields[257].setName("QTFY");
		fields[257].setDataType(DBFField.FIELD_TYPE_N);
		fields[257].setFieldLength(10);
		fields[258] = new DBFField();
		fields[258].setName("BLZDF");
		fields[258].setDataType(DBFField.FIELD_TYPE_N);
		fields[258].setFieldLength(10);
		fields[259] = new DBFField();
		fields[259].setName("SYSZDF");
		fields[259].setDataType(DBFField.FIELD_TYPE_N);
		fields[259].setFieldLength(10);
		fields[260] = new DBFField();
		fields[260].setName("YXXZDF");
		fields[260].setDataType(DBFField.FIELD_TYPE_N);
		fields[260].setFieldLength(10);
		fields[261] = new DBFField();
		fields[261].setName("LCZDXMF");
		fields[261].setDataType(DBFField.FIELD_TYPE_N);
		fields[261].setFieldLength(10);
		fields[262] = new DBFField();
		fields[262].setName("FSSZLXMF");
		fields[262].setDataType(DBFField.FIELD_TYPE_N);
		fields[262].setFieldLength(10);
		fields[263] = new DBFField();
		fields[263].setName("WLZLF");
		fields[263].setDataType(DBFField.FIELD_TYPE_N);
		fields[263].setFieldLength(10);
		fields[264] = new DBFField();
		fields[264].setName("SSZLF");
		fields[264].setDataType(DBFField.FIELD_TYPE_N);
		fields[264].setFieldLength(10);
		fields[265] = new DBFField();
		fields[265].setName("MAF");
		fields[265].setDataType(DBFField.FIELD_TYPE_N);
		fields[265].setFieldLength(10);
		fields[266] = new DBFField();
		fields[266].setName("SSF");
		fields[266].setDataType(DBFField.FIELD_TYPE_N);
		fields[266].setFieldLength(10);
		fields[267] = new DBFField();
		fields[267].setName("KFF");
		fields[267].setDataType(DBFField.FIELD_TYPE_N);
		fields[267].setFieldLength(10);
		fields[268] = new DBFField();
		fields[268].setName("ZYZLF");
		fields[268].setDataType(DBFField.FIELD_TYPE_N);
		fields[268].setFieldLength(10);
		fields[269] = new DBFField();
		fields[269].setName("XYF");
		fields[269].setDataType(DBFField.FIELD_TYPE_N);
		fields[269].setFieldLength(10);
		fields[270] = new DBFField();
		fields[270].setName("KJYWF");
		fields[270].setDataType(DBFField.FIELD_TYPE_N);
		fields[270].setFieldLength(10);
		fields[271] = new DBFField();
		fields[271].setName("ZCYF");
		fields[271].setDataType(DBFField.FIELD_TYPE_N);
		fields[271].setFieldLength(10);
		fields[272] = new DBFField();
		fields[272].setName("ZCYF1");
		fields[272].setDataType(DBFField.FIELD_TYPE_N);
		fields[272].setFieldLength(10);
		fields[273] = new DBFField();
		fields[273].setName("XF");
		fields[273].setDataType(DBFField.FIELD_TYPE_N);
		fields[273].setFieldLength(10);
		fields[274] = new DBFField();
		fields[274].setName("BDBLZPF");
		fields[274].setDataType(DBFField.FIELD_TYPE_N);
		fields[274].setFieldLength(10);
		fields[275] = new DBFField();
		fields[275].setName("QDBLZPF");
		fields[275].setDataType(DBFField.FIELD_TYPE_N);
		fields[275].setFieldLength(10);
		fields[276] = new DBFField();
		fields[276].setName("NXYZLZPF");
		fields[276].setDataType(DBFField.FIELD_TYPE_N);
		fields[276].setFieldLength(10);
		fields[277] = new DBFField();
		fields[277].setName("XBYZLZPF");
		fields[277].setDataType(DBFField.FIELD_TYPE_N);
		fields[277].setFieldLength(10);
		fields[278] = new DBFField();
		fields[278].setName("HCYYCLF");
		fields[278].setDataType(DBFField.FIELD_TYPE_N);
		fields[278].setFieldLength(10);
		fields[279] = new DBFField();
		fields[279].setName("YYCLF");
		fields[279].setDataType(DBFField.FIELD_TYPE_N);
		fields[279].setFieldLength(10);
		fields[280] = new DBFField();
		fields[280].setName("YCXYYCLF");
		fields[280].setDataType(DBFField.FIELD_TYPE_N);
		fields[280].setFieldLength(10);
		fields[281] = new DBFField();
		fields[281].setName("QTF");
		fields[281].setDataType(DBFField.FIELD_TYPE_N);
		fields[281].setFieldLength(10);
		writer.setFields(fields);

		// now populate DBFWriter
		//
		for (Map<String, Object> data : datas) {
			Map<String, Object> jsonMap = (Map<String, Object>)data.get("jsonMap");
			if(jsonMap != null){
				Object rowData[] = new Object[282];
				Map<String, Object> basicInfo = (Map<String, Object>)jsonMap.get("basicInfo");
				Map<String, Object> cureInfo = (Map<String, Object>)jsonMap.get("cureInfo");
				//[start] 0-29
				rowData[0] = getStringValue("山东曲阜人民医院");
				Object medicalPayTypeCode = basicInfo.get("medicalPayTypeCode");
				rowData[1] = getStringValue(medicalPayTypeCode);
				Object medicalHealthNumber = basicInfo.get("medicalHealthNumber");
				rowData[2] = getStringValue(medicalHealthNumber);
				Object visitNumber = basicInfo.get("visitNumber");
				rowData[3] = getStringValue(visitNumber);
				Object mrId = basicInfo.get("mrId");
				rowData[4] = getStringValue(mrId);
				Object patientName = basicInfo.get("patientName");
				rowData[5] = getStringValue(patientName);
				Object sexCode = basicInfo.get("sexCode");
				rowData[6] = getStringValue(sexCode);
				Object birthday = basicInfo.get("birthday");
				rowData[7] = getDateValue(birthday,"YYYYMMDD");
				Object yearOfAge = basicInfo.get("yearOfAge");
				rowData[8] =getDoubleValue(yearOfAge);
				Object nationalityCode = basicInfo.get("nationalityCode");
				rowData[9] = getStringValue(nationalityCode);
				Object monthOfAge = basicInfo.get("monthOfAge");
				rowData[10] = getStringValue(monthOfAge);
				if(cureInfo != null){
					Object babyBirthWeight = cureInfo.get("babyBirthWeight");
					rowData[11] = getDoubleValue(babyBirthWeight);
					Object babyInHospitalWeight = cureInfo.get("babyInHospitalWeight");
					rowData[12] = getDoubleValue(babyInHospitalWeight);
				}
				Map<String, Object> birthRegionalism =(Map<String, Object>)basicInfo.get("birthRegionalism");
				if(birthRegionalism != null){
					Object provinceCode = birthRegionalism.get("provinceCode");
					rowData[13] = getStringValue(provinceCode);
					Object cityCode = birthRegionalism.get("cityCode");
					rowData[14] = getStringValue(provinceCode);
					Object countyCode = birthRegionalism.get("countyCode");
					rowData[15] = getStringValue(provinceCode);
				}
				Object birthAddress = basicInfo.get("birthAddress");
				rowData[16] = getStringValue(birthAddress);

				Map<String, Object> nativePlaceRegionalism =(Map<String, Object>)basicInfo.get("nativePlaceRegionalism");

				if(nativePlaceRegionalism != null){
					Object provinceCode = nativePlaceRegionalism.get("provinceCode");
					rowData[17] = getStringValue(provinceCode);
					Object cityCode = nativePlaceRegionalism.get("cityCode");
					rowData[18] = getStringValue(cityCode);
				}
				Object nationCode = basicInfo.get("nationCode");
				rowData[19] = getStringValue(nationCode);
				Object documentTypeCode = basicInfo.get("documentTypeCode");
				rowData[20] = getStringValue(documentTypeCode);
				Object idNumber = basicInfo.get("idNumber");
				rowData[21] = getStringValue(idNumber);
				Object professionCode = basicInfo.get("professionCode");
				rowData[22] = getStringValue(professionCode);
				Object marriageCode = basicInfo.get("marriageCode");
				rowData[23] = getStringValue(marriageCode);
				Map<String, Object> permanentAddressRegionalism =(Map<String, Object>)basicInfo.get("permanentAddressRegionalism");
				if(permanentAddressRegionalism != null){
					Object provinceCode = permanentAddressRegionalism.get("provinceCode");
					rowData[24] = getStringValue(provinceCode);
					Object cityCode = permanentAddressRegionalism.get("cityCode");
					rowData[25] = getStringValue(cityCode);
					Object countyCode = permanentAddressRegionalism.get("countyCode");
					rowData[26] = getStringValue(countyCode);
				}
				Object permanentAddress = basicInfo.get("permanentAddress");
				rowData[27] = getStringValue(permanentAddress);
				Object permanentAddressPhone = basicInfo.get("permanentAddressPhone");
				rowData[28] = getStringValue(permanentAddressPhone);
				Object permanentAddressPostCode = basicInfo.get("permanentAddressPostCode");
				rowData[29] = getStringValue(permanentAddressPostCode);
				//[end]

				//[start] 30-59
				Map<String, Object> registeredAddressRegionalism =(Map<String, Object>)basicInfo.get("registeredAddressRegionalism");
				if(registeredAddressRegionalism != null){
					Object provinceCode = registeredAddressRegionalism.get("provinceCode");
					rowData[30] = getStringValue(provinceCode);
					Object cityCode = registeredAddressRegionalism.get("cityCode");
					rowData[31] = getStringValue(cityCode);
					Object countyCode = registeredAddressRegionalism.get("countyCode");
					rowData[32] = getStringValue(countyCode);
				}
				Object registeredAddress = basicInfo.get("registeredAddress");
				rowData[33] = getStringValue(registeredAddress);
				Object registeredAddressPostCode = basicInfo.get("registeredAddressPostCode");
				rowData[34] = getStringValue(registeredAddressPostCode);
				Object workUnitName = basicInfo.get("workUnitName");
				rowData[35] = getStringValue(workUnitName);
				Map<String, Object> workUnitRegionalism =(Map<String, Object>)basicInfo.get("workUnitRegionalism");
				if(workUnitRegionalism != null){
					Object provinceCode = workUnitRegionalism.get("provinceCode");
					rowData[36] = getStringValue(provinceCode);
					Object cityCode = workUnitRegionalism.get("cityCode");
					rowData[37] = getStringValue(cityCode);
					Object countyCode = workUnitRegionalism.get("countyCode");
					rowData[38] = getStringValue(countyCode);
				}
				Object workUnitAddress = basicInfo.get("workUnitAddress");
				rowData[39] = getStringValue(workUnitAddress);
				Object workUnitPhone = basicInfo.get("workUnitPhone");
				rowData[40] = getStringValue(workUnitPhone);
				Object workUnitPostCode = basicInfo.get("workUnitPostCode");
				rowData[41] = getStringValue(workUnitPostCode);
				Object linkManName = basicInfo.get("linkManName");
				rowData[42] = getStringValue(linkManName);
				Object linkManRelativeRelationCode = basicInfo.get("linkManRelativeRelationCode");
				rowData[43] = getStringValue(linkManRelativeRelationCode);

				Map<String, Object> linkManAddressRegionalism =(Map<String, Object>)basicInfo.get("linkManAddressRegionalism");
				if(linkManAddressRegionalism != null){
					Object provinceCode = linkManAddressRegionalism.get("provinceCode");
					rowData[44] = getStringValue(provinceCode);
					Object cityCode = linkManAddressRegionalism.get("cityCode");
					rowData[45] = getStringValue(cityCode);
					Object countyCode = linkManAddressRegionalism.get("countyCode");
					rowData[46] = getStringValue(countyCode);
				}
				Object linkManAddress = basicInfo.get("linkManAddress");
				rowData[47] = getStringValue(linkManAddress);
				Object linkManPhone = basicInfo.get("linkManPhone");
				rowData[48] = getStringValue(linkManPhone);
				Object inHospitalTypeCode = basicInfo.get("inHospitalTypeCode");
				rowData[49] = getStringValue(inHospitalTypeCode);
				Object shiftToUnitName = basicInfo.get("shiftToUnitName");
				rowData[50] = getStringValue(shiftToUnitName);
				Object inHospitalDateTimeObj = basicInfo.get("inHospitalDateTime");
				rowData[51] = getDateValue(inHospitalDateTimeObj,"YYYYMMDD");
				rowData[52] = getHourOfDateTime(inHospitalDateTimeObj);
				Object inDeptCode = basicInfo.get("inDeptCode");
				rowData[53] = getStringValue(inDeptCode);
				Object inHospitalHouseName = basicInfo.get("inHospitalHouseName");
				rowData[54] = getStringValue(inHospitalHouseName);
				Map<String, Object> transferDeptInfo = (Map<String, Object>)jsonMap.get("transferDeptInfo");
				if(transferDeptInfo != null){
					List<Map<String, Object>> transferDeptRecords = (List<Map<String, Object>>)transferDeptInfo.get("transferDeptRecords");
					int transferDeptRecordIndex = 0;
					for (Map<String, Object> transferDeptRecord : transferDeptRecords) {

						transferDeptRecordIndex++;
						if(transferDeptRecordIndex >3){
							break;
						}else{
							Object transferInDeptCode = transferDeptRecord.get("inDeptCode");
							rowData[54+transferDeptRecordIndex] = getStringValue(transferInDeptCode);
						}
					}
				}
				Object outHospitalDateTimeObj = basicInfo.get("outHospitalDateTime");
				rowData[58] = getDateValue(outHospitalDateTimeObj,"YYYYMMDD");
				rowData[59] = getHourOfDateTime(outHospitalDateTimeObj);
				//[end]

				//[start] 60-118
				Object outDeptCode = basicInfo.get("outDeptCode");
				rowData[60] = getStringValue(outDeptCode);
				Object outHospitalHouseName = basicInfo.get("outHospitalHouseName");
				rowData[61] = getStringValue(outHospitalHouseName);
				Object inHospitalDayNumber = basicInfo.get("inHospitalDayNumber");
				rowData[62] = getStringValue(inHospitalDayNumber);
				Map<String, Object> diseaseDiagInfo = (Map<String, Object>)jsonMap.get("hqmsDiseaseDiagInfo");
				if(diseaseDiagInfo != null){
					Map<String, Object> outpatientDiagRecord = (Map<String, Object>)diseaseDiagInfo.get("outpatientDiagRecord");
					Object outpatientDiseaseDiagName = outpatientDiagRecord.get("diseaseDiagName");
					rowData[63] = getStringValue(outpatientDiseaseDiagName);
					Object  outpatientDiseaseDiagCode = outpatientDiagRecord.get("diseaseDiagCode");
					rowData[64] = getStringValue(outpatientDiseaseDiagCode);
					Map<String, Object> mainDiagRecord = (Map<String, Object>)diseaseDiagInfo.get("mainDiagRecord");
					Object mainDiseaseDiagName = mainDiagRecord.get("diseaseDiagName");
					rowData[65] = getStringValue(mainDiseaseDiagName);
					Object mainDiseaseDiagCode = mainDiagRecord.get("diseaseDiagCode");
					rowData[66] = getStringValue(mainDiseaseDiagCode);
					Object mainInHospitalDiseaseStateCode = mainDiagRecord.get("inHospitalDiseaseStateCode");
					rowData[67] = getStringValue(mainInHospitalDiseaseStateCode);
					List<Map<String, Object>> ohterDiseaseDiagRecords = (List<Map<String, Object>>)diseaseDiagInfo.get("diseaseDiagRecords");
					int ohterDiseaseDiagRecordIndex = 0;
					for (Map<String, Object> ohterDiseaseDiagRecord : ohterDiseaseDiagRecords) {
						ohterDiseaseDiagRecordIndex++;
						if(ohterDiseaseDiagRecordIndex >15){
							break;
						}
						Object ohterDiseaseDiagName = ohterDiseaseDiagRecord.get("diseaseDiagName");
						rowData[68+(ohterDiseaseDiagRecordIndex-1)*3] = getStringValue(ohterDiseaseDiagName);
						Object ohterDiseaseDiagCode = ohterDiseaseDiagRecord.get("diseaseDiagCode");
						rowData[69+(ohterDiseaseDiagRecordIndex-1)*3] = getStringValue(ohterDiseaseDiagCode);
						Object ohterInHospitalDiseaseStateCode = ohterDiseaseDiagRecord.get("inHospitalDiseaseStateCode");
						rowData[70+(ohterDiseaseDiagRecordIndex-1)*3] = getStringValue(ohterInHospitalDiseaseStateCode);
					}
					List<Map<String, Object>> damageAndVenenationDiagRecords = (List<Map<String, Object>>)diseaseDiagInfo.get("damageAndVenenationDiagRecords");
					if(!damageAndVenenationDiagRecords.isEmpty()){
						Map<String, Object> damageAndVenenationDiagRecord = damageAndVenenationDiagRecords.get(0);
						Object damageAndVenenationDiseaseDiagName = damageAndVenenationDiagRecord.get("diseaseDiagName");
						rowData[113] = getStringValue(damageAndVenenationDiseaseDiagName);
						Object damageAndVenenationDiseaseDiagCode = damageAndVenenationDiagRecord.get("diseaseDiagCode");
						rowData[114] = getStringValue(damageAndVenenationDiseaseDiagCode);
					}
					List<Map<String, Object>> pathologyDiagRecords = (List<Map<String, Object>>)diseaseDiagInfo.get("pathologyDiagRecords");
					if(!pathologyDiagRecords.isEmpty()){
						Map<String, Object> pathologyDiagRecord = pathologyDiagRecords.get(0);
						Object pathologyDiseaseDiagName = pathologyDiagRecord.get("diseaseDiagName");
						rowData[115] = getStringValue(pathologyDiseaseDiagName);
						Object pathologyDiseaseDiagCode = pathologyDiagRecord.get("diseaseDiagCode");
						rowData[116] = getStringValue(pathologyDiseaseDiagCode);
						Object pathologyNumber = pathologyDiagRecord.get("pathologyNumber");
						rowData[117] = getStringValue(pathologyNumber);
					}
				}
				//[end]

				//[start] 119-141
				if(cureInfo != null){
					Object malignantTumorHighestDiagBasisCode = cureInfo.get("malignantTumorHighestDiagBasisCode");
					rowData[119] = getStringValue(malignantTumorHighestDiagBasisCode);

				}
				Object drugAllergyDesc = basicInfo.get("drugAllergyDesc");
				rowData[120] = getStringValue(drugAllergyDesc);
				Object autopsyCode = basicInfo.get("autopsyCode");
				rowData[122] = getStringValue(autopsyCode);
				if(cureInfo != null){
					Object bloodTypeCode = cureInfo.get("bloodTypeCode");
					rowData[123] = getStringValue(bloodTypeCode);
				}
				Map<String, Object> nurseInfo = (Map<String, Object>)jsonMap.get("nurseInfo");
				if(nurseInfo != null){
					Object specialNurseDayNumber = nurseInfo.get("specialNurseDayNumber");
					Object specialNurseHourNumber = nurseInfo.get("specialNurseHourNumber");
					if(specialNurseDayNumber != null && specialNurseHourNumber != null){
						rowData[124] = ""+getIntegerValue(specialNurseDayNumber)+" "+getIntegerValue(specialNurseHourNumber)+"/24";
					}else if(specialNurseDayNumber != null){
						rowData[124] = ""+getIntegerValue(specialNurseDayNumber);
					}else if(specialNurseHourNumber != null){
						rowData[124] = getIntegerValue(specialNurseHourNumber)+"/24";
					}
					Object firstLevelNurseDayNumber = nurseInfo.get("firstLevelNurseDayNumber");
					rowData[125] = getDoubleValue(firstLevelNurseDayNumber);
					Object secondLevelNurseDayNumber = nurseInfo.get("secondLevelNurseDayNumber");
					rowData[126] = getDoubleValue(secondLevelNurseDayNumber);
					Object threeLevelNurseDayNumber = nurseInfo.get("threeLevelNurseDayNumber");
					rowData[127] = getDoubleValue(threeLevelNurseDayNumber);

				}
				if(cureInfo != null){
					Object rhBloodTypeCode = cureInfo.get("rhBloodTypeCode");
					rowData[128] = getStringValue(rhBloodTypeCode);
				}
				if(cureInfo != null){
					List<Map<String, Object>> cureWorkers = (List<Map<String, Object>>)cureInfo.get("cureWorkers");
					String workerA1001Name=null;
					String workerA1003Name=null;
					String workerA2001Name=null;
					String workerA2003Name=null;
					String workerA2005Name=null;
					String workerA3001Name=null;
					String workerA2006Name=null;
					String workerA2008Name=null;
					String workerA4001Name=null;
					String workerA2009Name=null;
					String workerA3003Name=null;
					for (Map<String, Object> cureWorker : cureWorkers) {
						String professionTitleCode = (String)cureWorker.get("professionTitleCode");
						if("A1001".equals(professionTitleCode)){
							workerA1001Name = (String)cureWorker.get("medicalWorkerName");
						}else if("A1003".equals(professionTitleCode)){
							workerA1003Name = (String)cureWorker.get("medicalWorkerName");
						}else if("A2001".equals(professionTitleCode)){
							workerA2001Name = (String)cureWorker.get("medicalWorkerName");
						}else if("A2003".equals(professionTitleCode)){
							workerA2003Name = (String)cureWorker.get("medicalWorkerName");
						}else if("A2005".equals(professionTitleCode)){
							workerA2005Name = (String)cureWorker.get("medicalWorkerName");
						}else if("A3001".equals(professionTitleCode)){
							workerA3001Name = (String)cureWorker.get("medicalWorkerName");
						}else if("2006".equals(professionTitleCode)){
							workerA2006Name = (String)cureWorker.get("medicalWorkerName");
						}else if("A2008".equals(professionTitleCode)){
							workerA2008Name = (String)cureWorker.get("medicalWorkerName");
						}else if("A4001".equals(professionTitleCode)){
							workerA4001Name = (String)cureWorker.get("medicalWorkerName");
						}else if("A2009".equals(professionTitleCode)){
							workerA2009Name = (String)cureWorker.get("medicalWorkerName");
						}else if("A3003".equals(professionTitleCode)){
							workerA3003Name = (String)cureWorker.get("medicalWorkerName");
						}
					}
					rowData[129]=workerA1001Name;
					rowData[130]=workerA1003Name;
					rowData[131]=workerA2001Name;
					rowData[132]=workerA2003Name;
					rowData[133]=workerA2005Name;
					rowData[134]=workerA3001Name;
					rowData[135]=workerA2006Name;
					rowData[136]=workerA2008Name;
					rowData[137]=workerA4001Name;
					Object medicalRecordQualityCode = cureInfo.get("medicalRecordQualityCode");
					rowData[138] = getStringValue(medicalRecordQualityCode);
					rowData[139]=workerA2009Name;
					rowData[140]=workerA3003Name;
					Object qualityControlDateTimeObj = cureInfo.get("qualityControlDateTime");
					rowData[141]=getDateValue(qualityControlDateTimeObj, "YYYYMMDD");
				}
				//[end]

				//[start] 142-237
				Map<String, Object> operateInfo = (Map<String, Object>)jsonMap.get("hqmsOperateInfo");
				if(operateInfo != null){
					List<Map<String, Object>> operateRecords = (List<Map<String, Object>>)operateInfo.get("operateRecords");
					int operateRecordIndex = 0;
					for (Map<String, Object> operateRecord : operateRecords) {
						operateRecordIndex++;
						if(operateRecordIndex > 8){
							break;
						}
						Object operateCode = operateRecord.get("operateCode");
						rowData[142+(operateRecordIndex-1)*12]=getStringValue(operateCode);
						Object operateStartDateObj = operateRecord.get("operateStartDate");
						rowData[143+(operateRecordIndex-1)*12]=getDateValue(operateStartDateObj, "YYYYMMDD");
						Object opsLevelCode = operateRecord.get("opsLevelCode");
						rowData[144+(operateRecordIndex-1)*12]=getStringValue(opsLevelCode);
						Object patientSourceCode = operateRecord.get("patientSourceCode");
						rowData[145+(operateRecordIndex-1)*12]=getStringValue(patientSourceCode);
						Object operateName = operateRecord.get("operateName");
						rowData[146+(operateRecordIndex-1)*12]=getStringValue(operateName);
						List<Map<String, Object>> operateWorkers = (List<Map<String, Object>>)operateRecord.get("operateWorkers");
						String workerA5001Name=null;
						String workerA5002Name=null;
						String workerA5003Name=null;
						String workerA5004Name=null;
						for (Map<String, Object> operateWorker : operateWorkers) {
							String professionTitleCode = (String)operateWorker.get("professionTitleCode");
							if("A5001".equalsIgnoreCase(professionTitleCode)){
								workerA5001Name = (String)operateWorker.get("medicalWorkerName");
							}else if("A5002".equalsIgnoreCase(professionTitleCode)){
								workerA5002Name = (String)operateWorker.get("medicalWorkerName");
							}else if("A5003".equalsIgnoreCase(professionTitleCode)){
								workerA5003Name = (String)operateWorker.get("medicalWorkerName");
							}else if("A5004".equalsIgnoreCase(professionTitleCode)){
								workerA5004Name = (String)operateWorker.get("medicalWorkerName");
							}
						}
						rowData[147+(operateRecordIndex-1)*12]=workerA5001Name;
						rowData[148+(operateRecordIndex-1)*12]=workerA5003Name;
						rowData[149+(operateRecordIndex-1)*12]=workerA5004Name;
						Object incisionLevelCode = operateRecord.get("incisionLevelCode");
						rowData[150+(operateRecordIndex-1)*12]=getStringValue(incisionLevelCode);
						Object cicatrizeTypeCode = operateRecord.get("cicatrizeTypeCode");
						rowData[151+(operateRecordIndex-1)*12]=getStringValue(cicatrizeTypeCode);
						Object anaesthesiaTypeCode = operateRecord.get("anaesthesiaTypeCode");
						rowData[152+(operateRecordIndex-1)*12]=getStringValue(anaesthesiaTypeCode);
						rowData[152+(operateRecordIndex-1)*12]=workerA5002Name;
					}
				}
				//[end]

				if(cureInfo != null){
					Object whetherEnterClinicalPathsCode = cureInfo.get("whetherEnterClinicalPathsCode");
					rowData[238] = getStringValue(whetherEnterClinicalPathsCode);
					Object whetherFinishClinicalPathsCode = cureInfo.get("whetherFinishClinicalPathsCode");
					rowData[239] = getStringValue(whetherFinishClinicalPathsCode);
					Object whetherConditionVariationCode = cureInfo.get("whetherConditionVariationCode");
					rowData[240] = getStringValue(whetherConditionVariationCode);
				}

				Object outHospitalTypeCode = basicInfo.get("outHospitalTypeCode");
				rowData[241] = getStringValue(outHospitalTypeCode);
				Object receiveUnitName = basicInfo.get("receiveUnitName");
				if(outHospitalTypeCode!=null){
					if("2".equalsIgnoreCase((String)outHospitalTypeCode)){
						rowData[242] = receiveUnitName;
					}else if("3".equalsIgnoreCase((String)outHospitalTypeCode)){
						rowData[243] = receiveUnitName;
					}
				}
				if(cureInfo != null){
					Object rehospitalAimOf31Code = cureInfo.get("rehospitalAimOf31Code");
					rowData[244] = getStringValue(rehospitalAimOf31Code);
					Object rehospitalAimOf31Description = cureInfo.get("rehospitalAimOf31Description");
					rowData[245] = getStringValue(rehospitalAimOf31Description);
					Object dayOfBeforeInHospitalComa = cureInfo.get("dayOfBeforeInHospitalComa");
					rowData[246] = getDoubleValue(dayOfBeforeInHospitalComa);
					Object hourOfBeforeInHospitalComa = cureInfo.get("hourOfBeforeInHospitalComa");
					rowData[247] = getDoubleValue(hourOfBeforeInHospitalComa);
					Object minuteOfBeforeInHospitalComa = cureInfo.get("minuteOfBeforeInHospitalComa");
					rowData[248] = getDoubleValue(minuteOfBeforeInHospitalComa);
					Object dayOfAfterInHospitalComa = cureInfo.get("dayOfAfterInHospitalComa");
					rowData[249] = getDoubleValue(dayOfAfterInHospitalComa);
					Object hourOfAfterInHospitalComa = cureInfo.get("hourOfAfterInHospitalComa");
					rowData[250] = getDoubleValue(hourOfAfterInHospitalComa);
					Object minuteOfAfterInHospitalComa = cureInfo.get("minuteOfAfterInHospitalComa");
					rowData[251] = getDoubleValue(minuteOfAfterInHospitalComa);
				}

				Map<String, Object> costInfo = (Map<String, Object>)jsonMap.get("costInfo");
				if(costInfo != null){
					Object totalCost = costInfo.get("totalCost");
					rowData[252] = getDoubleValue(totalCost);
					Object selfCost = costInfo.get("selfCost");
					rowData[253] = getDoubleValue(selfCost);
					List<Map<String, Object>> costRecords = (List<Map<String, Object>>)costInfo.get("costRecords");
					int costRecordIndex = 0;
					for (Map<String, Object> costRecord : costRecords) {
						Object medicalCostTypeCode = costRecord.get("medicalCostTypeCode");
						Object costMoney = costRecord.get("costMoney");
						if(("C01001").equalsIgnoreCase((String)medicalCostTypeCode)){
							Object costC01001 = costMoney;
							rowData[254] = getDoubleValue(costC01001);
						}else if(("C01002").equalsIgnoreCase((String)medicalCostTypeCode)){
							Object costC01002 = costMoney;
							rowData[255] = getDoubleValue(costC01002);
						}else if(("C01003").equalsIgnoreCase((String)medicalCostTypeCode)){
							Object costC01003 = costMoney;
							rowData[256] = getDoubleValue(costC01003);
						}else if(("C01999").equalsIgnoreCase((String)medicalCostTypeCode)){
							Object costC01999 = costMoney;
							rowData[257] = getDoubleValue(costC01999);
						}else if(("C02001").equalsIgnoreCase((String)medicalCostTypeCode)){
							Object costC02001 = costMoney;
							rowData[258] = getDoubleValue(costC02001);
						}else if(("C02002").equalsIgnoreCase((String)medicalCostTypeCode)){
							Object costC02002 = costMoney;
							rowData[259] = getDoubleValue(costC02002);
						}else if(("C02003").equalsIgnoreCase((String)medicalCostTypeCode)){
							Object costC02003 = costMoney;
							rowData[260] = getDoubleValue(costC02003);
						}else if(("C02004").equalsIgnoreCase((String)medicalCostTypeCode)){
							Object costC02004 = costMoney;
							rowData[261] = getDoubleValue(costC02004);
						}else if(("C03001").equalsIgnoreCase((String)medicalCostTypeCode)){
							Object costC03001 = costMoney;
							rowData[262] = getDoubleValue(costC03001);
						}else if(("C03002").equalsIgnoreCase((String)medicalCostTypeCode)){
							Object costC03002 = costMoney;
							rowData[263] = getDoubleValue(costC03002);
						}else if(("C03003").equalsIgnoreCase((String)medicalCostTypeCode)){
							Object costC03003 = costMoney;
							rowData[264] = getDoubleValue(costC03003);
						}else if(("C03004").equalsIgnoreCase((String)medicalCostTypeCode)){
							Object costC03004 = costMoney;
							rowData[265] = getDoubleValue(costC03004);
						}else if(("C03005").equalsIgnoreCase((String)medicalCostTypeCode)){
							Object costC03005 = costMoney;
							rowData[266] = getDoubleValue(costC03005);
						}else if(("C04001").equalsIgnoreCase((String)medicalCostTypeCode)){
							Object costC04001 = costMoney;
							rowData[267] = getDoubleValue(costC04001);
						}else if(("C05001").equalsIgnoreCase((String)medicalCostTypeCode)){
							Object costC05001 = costMoney;
							rowData[268] = getDoubleValue(costC05001);
						}else if(("C06001").equalsIgnoreCase((String)medicalCostTypeCode)){
							Object costC06001 = costMoney;
							rowData[269] = getDoubleValue(costC06001);
						}else if(("C06002").equalsIgnoreCase((String)medicalCostTypeCode)){
							Object costC06002 = costMoney;
							rowData[270] = getDoubleValue(costC06002);
						}else if(("C07001").equalsIgnoreCase((String)medicalCostTypeCode)){
							Object costC07001 = costMoney;
							rowData[271] = getDoubleValue(costC07001);
						}else if(("C07002").equalsIgnoreCase((String)medicalCostTypeCode)){
							Object costC07002 = costMoney;
							rowData[272] = getDoubleValue(costC07002);
						}else if(("C08001").equalsIgnoreCase((String)medicalCostTypeCode)){
							Object costC08001 = costMoney;
							rowData[273] = getDoubleValue(costC08001);
						}else if(("C08002").equalsIgnoreCase((String)medicalCostTypeCode)){
							Object costC08002 = costMoney;
							rowData[274] = getDoubleValue(costC08002);
						}else if(("C08003").equalsIgnoreCase((String)medicalCostTypeCode)){
							Object costC08003 = costMoney;
							rowData[275] = getDoubleValue(costC08003);
						}else if(("C08004").equalsIgnoreCase((String)medicalCostTypeCode)){
							Object costC08004 = costMoney;
							rowData[276] = getDoubleValue(costC08004);
						}else if(("C08005").equalsIgnoreCase((String)medicalCostTypeCode)){
							Object costC08005 = costMoney;
							rowData[277] = getDoubleValue(costC08005);
						}else if(("C09001").equalsIgnoreCase((String)medicalCostTypeCode)){
							Object costC09001 = costMoney;
							rowData[278] = getDoubleValue(costC09001);
						}else if(("C09002").equalsIgnoreCase((String)medicalCostTypeCode)){
							Object costC09002 = costMoney;
							rowData[279] = getDoubleValue(costC09002);
						}else if(("C09003").equalsIgnoreCase((String)medicalCostTypeCode)){
							Object costC09003 = costMoney;
							rowData[280] = getDoubleValue(costC09003);
						}else if(("C99999").equalsIgnoreCase((String)medicalCostTypeCode)){
							Object costC99999 = costMoney;
							rowData[281] = getDoubleValue(costC99999);
						}


					}
				}

				writer.addRecord(rowData);
			}
		}



		writer.write(out);


	}

	private static Object getDoubleValue(Object obj){
		if(obj instanceof String){
			return new BigDecimal((String)obj);
		}else if(obj instanceof Integer){
			return new BigDecimal((Integer)obj);
		}else if(obj instanceof BigDecimal){
			return (BigDecimal)obj;
		}else if(obj instanceof Long){
			return new BigDecimal((Long)obj);
		}else if(obj instanceof Double){
			return new BigDecimal((Double)obj);
		}else{
			return null;
		}
	}

	private static Object getIntegerValue(Object obj){
		if(obj instanceof String){

			return new Double((String)obj).intValue();
		}else if(obj instanceof Integer){
			return new Double((Integer)obj).intValue();
		}else if(obj instanceof BigDecimal){
			return ((BigDecimal)obj).intValue();
		}else if(obj instanceof Long){
			return ((Long)obj).intValue();
		}else if(obj instanceof Long){
			return ((Double)obj).intValue();
		}else{
			return null;
		}
	}


	private static Object getStringValue(Object obj){
		if(obj instanceof String){
			/*if(Charset.defaultCharset().equals(Charset.forName("UTF-8"))){
				return new String(((String)obj).getBytes(Charset.forName("UTF-8")),Charset.forName("GBK"));
			}*/
			return (String)obj;
		}else if(obj instanceof Integer){
			return String.format("%d", (Integer)obj);
		}else if(obj instanceof BigDecimal){
			return String.format("%f",((BigDecimal)obj).doubleValue());
		}else if(obj instanceof Long){
			return  String.format("%f",((Long)obj).doubleValue());
		}else if(obj instanceof Double){
			return  String.format("%f",((Double)obj).doubleValue());
		}else{
			return null;
		}
	}

	private static Object getDateValue(Object obj,String dateTimeformat){
		if(obj instanceof String){
			String date = (String)obj;
			date = date.replace("-", "");
			if(date.length() == 8){
				return date;
			}else{
				return date.substring(0, 8);
			}

		}else if(obj instanceof Date){
			return DateUtil.dateFormat(dateTimeformat,(Date)obj);
		}else{
			return null;
		}
	}


	private static Object getDateTimeValue(Object obj,String dateTimeformat){
		if(obj instanceof String){
			String date = (String)obj;
			return date.replace("-", "").replace(":", "").replace(" ", "");
		}else if(obj instanceof Date){
			return DateUtil.dateFormat(dateTimeformat,(Date)obj);
		}else{
			return null;
		}
	}

	private static Object getHourOfDateTime(Object obj){
		if(obj instanceof String){
			String date = (String)obj;
			Date dateTime;
			try {
				dateTime = DateUtil.dateParse(DateUtil.DATE_TIME_FORMATE, date);
				return new Double(DateUtil.dateFormat("HH",dateTime));
			} catch (ParseException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
				return null;
			}


		}else if(obj instanceof Date){
			return new Double(DateUtil.dateFormat("HH",(Date)obj));
		}else{
			return null;
		}
	}

}
